二、本地npm服务配置及使用

  在上一篇中,我们已经搭建好了本地npm服务,这一篇中,我们将通过工具nrm配置客户端的npm

  1、通过npm安装全局nrm

npm install -g nrm

  2、通过nrm添加私有npm服务镜像地址

nrm add my http://serviceIP:4873  # 添加本地的npm镜像地址
 

  3、使用私有npm服务镜像地址

nrm use my # 使用本址的镜像地址     my为你要增加的地址

  4、私有npm服务增加用户

npm adduser
Username: test
Password: test
Email: (this IS public) xxx@xxxx

  5、登陆私有npm服务

npm login

  6、完成公共模块的发布

npm publish

猜你喜欢

转载自www.cnblogs.com/fordreaming/p/11690010.html