假设nodejs私服地址为:
http://192.168.1.21:8081/repository/npm_proxy
切换到前端项目路径打开cmd窗口
下载npm源管理工具nrm
npm install nrm -g
nrm add <自定义源名> <源的url>,例如:
nrm add aname http://192.168.1.21:8081/repository/npm_proxy
nrm use <自定义源名>,例如:
nrm use aname
以上,设置完成。