NodeJS Npm更新- npm错误!系统调用重命名

pftdvrlh  于 2022-12-26  发布在  Node.js
关注(0)|答案(2)|浏览(473)

在我的项目中,我想创建一个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

但总是这个错误...有人能帮帮我吗

uinbv5nw

uinbv5nw1#

对于遇到此问题的其他人:确保没有打开的文件可能正在使用这些文件。

  • 如果项目服务器正在运行,请将其关闭。
  • 如果在IDE中打开了该项目,请将其关闭。
  • 如果你有一些文件在文件浏览器中打开,关闭它.

然后重试npm命令。

bbuxkriu

bbuxkriu2#

我认为你可以尝试重新安装节点和npm。这是唯一的解决方案,为我工作。

相关问题