使用verdaccio
安装
npm install --global verdaccio
启动
verdaccio
linux后台启动
forever start `which verdaccio`
直接打开 http://localhost:4873/
添加用户
npm adduser --registry http://localhost:4873
然后我们在http://localhost:4873/上面直接点Login就可以登陆了
package.json
"publishConfig": {
"registry": "http://localhost:4873"
},
当本地库没有时远程库提供下载
uplinks:
npmjs:
url: https://registry.npm.taobao.org/
配置服务上所有人都可以下载
listen:0.0.0.0:4879
就换为了4879端口号