解决npm install -g cnpm --registry=https://registry.npm.taobao.org报错

解决方法

  1. npm cache clean --force 清除缓存
  2. npm config set registry https://registry.npm.taobao.org 设置淘宝源
  3. npm install 再次运行 如果不成功 多运行几次
    以下是报错信息
PS D:\TXT\vueT> npm install -g cnpm --registry=https://registry.npm.taobao.org
npm ERR! syscall mkdir
npm ERR! errno -4048
npm ERR!  [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\cnpm'] {
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\cnpm'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\JDX\AppData\Local\npm-cache\_logs\2021-09-26T15_14_42_117Z-debug.log

你可能感兴趣的:(VUE,vue)