1.在命令行里指定源,改变全局的注册
[root@devops ~]# npm config set registry https://registry.npm.taobao.org
2.修改~/.npmrc 配置文件
[root@devops ~]# vim ~/.npmrc
registry=https://registry.npm.taobao.org
[root@devops ~]# npm config get registry
https://registry.npm.taobao.org/