解决方法

  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
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐