1 2 3 4

npm 注册淘宝镜像

临时使用
npm --registry https://registry.npm.taobao.org install express
1
2.持久使用
npm config set registry https://registry.npm.taobao.org
1
配置后可通过下面方式来验证是否成功
npm config get registry

npm info express
3.通过cnpm使用
npm install -g cnpm --registry=https://registry.npm.taobao.org
1
使用
cnpm install express
4.恢复使用
npm config set registry https://registry.npmjs.org

5、解决powershell不能运行npm全局安装的命令
使用管理员打开powershell,在c:windows下执行get-ExecutionPolicy,如果显示的是Restricted说明他是禁止的。
接下来就要执行set-ExecutionPolicy RemoteSigned回车,输入A 然后回车就好了。

原文链接:https://blog.csdn.net/quuqu/java/article/details/64121812

posted @ 2020-06-17 17:11  startscorpio  阅读(1742)  评论(0编辑  收藏  举报