发新帖

[Nodejs] npm ERR! code EPERM npm ERR! syscall rename

零下一度 2024-3-21 678
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\Administrator\AppData\Roaming\npm\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\node_modules\@npmcli
npm ERR! dest C:\Users\Administrator\AppData\Roaming\npm\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\Administrator\AppData\Roaming\npm\node_modules\cnpm\node_modules\.make-fetch-happen.DELETE\
node_modules\@npmcli' -> 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli'
npm ERR!  [OperationalError: EPERM: operation not permitted, rename 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\cnpm\node_modules\.make-fetch-h
appen.DELETE\node_modules\@npmcli' -> 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\cnpm\node_modules\make-fetch-happen\node_modules\@npmcli'] { 
npm ERR!   cause: [Error: EPERM: operation not permitted, rename 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\cnpm\node_modules\.make-fetch-happ
en.DELETE\node_modules\@npmcli' -> 'C:\Users\Administrator\AppData\Roaming\npm\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\\Administrator\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\.make-fetch-happen.DELETE\\node_modules\\@npmcli',   
npm ERR!     dest: 'C:\\Users\\Administrator\\AppData\\Roaming\\npm\\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!   syscall: 'rename',npm ERR!   syscall: 'rename',npm ERR!   path: 
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\Administrator\AppData\Roaming\npm-cache\_logs\2024-03-21T09_54_20_716Z-debug.log


出现以上问题一般是因为npm 安装组件的版本问题引起的


解决方法:

rm -rf node_modules
rm package-lock.json
npm cache clean --force


最新回复 (0)
返回
零下一度
主题数
931
帖子数
0
注册排名
1