node安装cnpm淘宝镜像

1.npm install -g cnpm --registry=https://registry.npm.taobao.org

安装cnpm淘宝镜像。

2.如果报错无权限,则需要用管理员身份运行并且授权

执行set-ExecutionPolicy RemoteSigned

然后

y

 就可以继续启动node.js命令了

3.如果cnpm i报错  Error: Cannot find module ‘diagnostics_channel‘

因为cnpm版本过于高

npm uninstall -g cnpm删除cnpm

npm install [email protected] -g重新安装cnpm版本7.1.0

参考文章cnpm : 无法加载文件 D:\nodejs\node_global\cnpm.ps1,因为在此系统上禁止运行脚本_醉梦洛的博客-CSDN博客

猜你喜欢

转载自blog.csdn.net/aleluye/article/details/128314214