配置npm仓储
npm config set registry 仓库地址
验证配置是否正确
npm config list
- 添加用户
npm adduser -registry 仓库地址
npm adduser -registry http://xxx.xx.x.x:xxxx/repository/npm-hosted/
Username: admin
Password:
Email: (this IS public) demo-test@devops.com
Logged in as admin on http://xxx.xx.x.x:xxxx/repository/npm-hosted/.
- 上传包
npm publish -registry 仓库地址 https://registry.npmjs.org/ 或者 现在package.json 添加仓库地址 “publishConfig”: { “registry”: “仓库地址” } npm publish