npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path D:\Program Files\nvm\v14.15.1\node_global\node_modules\cnpm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli
npm ERR! dest D:\Program Files\nvm\v14.15.1\node_global\node_modules\cnpm\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'D:\Program Files\nvm\v14.15.1\node_global\node_modules\cnpm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli' -> 'D:\Program Files\nvm\v14.15.1\node_global\node_modules\cnpm\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli'
npm ERR! [OperationalError: EPERM: operation not permitted, rename 'D:\Program Files\nvm\v14.15.1\node_global\node_modules\cnpm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli' -> 'D:\Program Files\nvm\v14.15.1\node_global\node_modules\cnpm\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli'] {
npm ERR! cause: [Error: EPERM: operation not permitted, rename 'D:\Program Files\nvm\v14.15.1\node_global\node_modules\cnpm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@npmcli' -> 'D:\Program Files\nvm\v14.15.1\node_global\node_modules\cnpm\node_modules\npm\node_modules\node-gyp\node_modules\@npmcli'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'D:\\Program Files\\nvm\\v14.15.1\\node_global\\node_modules\\cnpm\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@npmcli',
npm ERR! dest: 'D:\\Program Files\\nvm\\v14.15.1\\node_global\\node_modules\\cnpm\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@npmcli'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm install -g cnpm --registry=https://registry.npm.taobao.org
安装时出现如上问题,npm低版本存在BUG,需要升级到8.3.1,指令如下
npm install --global npm@8.3.1
参考:Windows: Cannot update global npm version after using setup-node · Issue #411 · actions/setup-node · GitHub
另外目前cnpm版本是9.2.0,安装使用:
npm install cnpm -g --registry=https://registry.npmmirror.com
参考:cnpm - npm