当前位置:   article > 正文

cnpm安装报错记录_安装cnpm失败 npm err! code eperm

安装cnpm失败 npm err! code eperm

使用 npm install -g cnpm安装时报错,网上很多解决方法都没效果,最后指定了版本终于解决了这个问题

报错信息

npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\admin\AppData\Roaming\nvm\v14.21.3\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli
npm ERR! dest C:\Users\admin\AppData\Roaming\nvm\v14.21.3\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\admin\AppData\Roaming\nvm\v14.21.3\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli' -> 'C:\Users\admin\AppData\Roaming\nvm\v14.21.3\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli'
npm ERR!  [OperationalError: EPERM: operation not permitted, rename 'C:\Users\admin\AppData\Roaming\nvm\v14.21.3\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli' -> 'C:\Users\admin\AppData\Roaming\nvm\v14.21.3\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, rename 'C:\Users\admin\AppData\Roaming\nvm\v14.21.3\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli' -> 'C:\Users\admin\AppData\Roaming\nvm\v14.21.3\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'rename',
npm ERR!     path: 'C:\\Users\\admin\\AppData\\Roaming\\nvm\\v14.21.3\\node_modules\\cnpm\\node_modules\\.make-fetch-happen.DELETE\\node_modules\\@npmcli',
npm ERR!     dest: 'C:\\Users\\admin\\AppData\\Roaming\\nvm\\v14.21.3\\node_modules\\cnpm\\node_modules\\make-fetch-happen\\node_modules\\@npmcli'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'C:\\Users\\admin\\AppData\\Roaming\\nvm\\v14.21.3\\node_modules\\cnpm\\node_modules\\.make-fetch-happen.DELETE\\node_modules\\@npmcli',
npm ERR!   dest: 'C:\\Users\\admin\\AppData\\Roaming\\nvm\\v14.21.3\\node_modules\\cnpm\\node_modules\\make-fetch-happen\\node_modules\\@npmcli',
npm ERR!   parent: 'cnpm'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\admin\AppData\Roaming\npm-cache\_logs\2023-12-29T07_52_50_909Z-debug.log
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32

解决方案

我的是node 14.21.3 npm版本 6.14.18

npm install cnpm@7.1.0 -g
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/586553
推荐阅读
相关标签
  

闽ICP备14008679号