发布npm依赖到私有源Nexus
本地上传
- 设置Npm仓库
npm config set registry http://xxx.com/repository/xxx/
- 登录Npm仓库
npm login --registry=http://xxx.com/repository/xxx/
username: xxx
password:******
- 在
package.json中添加如下配置
"publishConfig":{"registry":"http://xxx.com/repository/xxx/"}
- 上传
npm publish
注:报400可能是账号没有上传权限
示例截图
手动上传
- 登录仓库
- 打包
npm pack
- 上传