在我的项目中,我想创建一个npm update
,但是我总是犯这样的错误:
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\user\Desktop\SylviaTest\node_modules\bootswatch
npm ERR! dest C:\Users\user\Desktop\SylviaTest\node_modules\.bootswatch-9Qtq80Xi
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\user\Desktop\SylviaTest\node_modules\bootswatch' -> 'C:\Users\user\Desktop\SylviaTest\node_modules\.bootswatch-9Qtq80Xi'
npm ERR! [Error: EPERM: operation not permitted, rename 'C:\Users\user\Desktop\SylviaTest\node_modules\bootswatch' -> 'C:\Users\user\Desktop\SylviaTest\node_modules\.bootswatch-9Qtq80Xi
'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\user\\Desktop\\SylviaTest\\node_modules\\bootswatch',
npm ERR! dest: 'C:\\Users\\user\\Desktop\\SylviaTest\\node_modules\\.bootswatch-9Qtq80Xi'
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缓存清除-强制
- npm安装
- npm安装-g npm
但总是这个错误...有人能帮帮我吗
2条答案
按热度按时间uinbv5nw1#
对于遇到此问题的其他人:确保没有打开的文件可能正在使用这些文件。
然后重试npm命令。
bbuxkriu2#
我认为你可以尝试重新安装节点和npm。这是唯一的解决方案,为我工作。