尝试运行npm install-g npm时出现npm错误

cvxl0en2  于 2022-11-24  发布在  其他
关注(0)|答案(1)|浏览(480)

Receiving the foillowing error, when I try to search C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules.node-gyp.DELETE\node_modules@npmcli via run app it tell mes that it cannot find the file
error when using run command to find path
Picture of error code in cmd C:\GreaterWMS\templates>npm install -g npm npm ERR! code EPERM npm ERR! syscall rename npm ERR! path C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules.node-gyp.DELETE\node_modules@npmcli npm ERR! dest C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules@npmcli npm ERR! errno -4048 npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules.node-gyp.DELETE\node_modules@npmcli' -> 'C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules@npmcli' npm ERR! [OperationalError: EPERM: operation not permitted, rename 'C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules.node-gyp.DELETE\node_modules@npmcli' -> 'C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules@npmcli'] { npm ERR! cause: [Error: EPERM: operation not permitted, rename 'C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules.node-gyp.DELETE\node_modules@npmcli' -> 'C:\Users\harka\AppData\Roaming\npm\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: 'C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules.node-gyp.DELETE\node_modules@npmcli', npm ERR! dest: 'C:\Users\harka\AppData\Roaming\npm\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 ERR! path: 'C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules.node-gyp.DELETE\node_modules@npmcli', npm ERR! dest: 'C:\Users\harka\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules@npmcli', npm ERR! parent: 'npm' 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\harka\AppData\Roaming\npm-cache_logs\2022-11-15T14_28_23_790Z-debug.log
I have no idea how to fix this error, I have tried creating a temporary cache I have wiped my entire computer and reset and restarted the entire process from scratch but I keep receiving this same error.

  1. I have turned off my firewall 2.I have turned off all anti virus software 3.I have tried deleting the Roaming data npm folder and tried to reinstall npm, but everything that I try to do nothing will fix this error.
  2. thought maybe because my user for my microsoft is 2 names (First and Last, I then turn my pc into a local machine so it the user would only be "harka"
vlju58qv

vlju58qv1#

你以前安装过npm吗,你能运行例如npm -v吗?如果没有,这意味着你根本没有安装npm,你试图用它来安装npm(如果我没有弄错的话)。那么假设你使用的是windows,安装npm到windows的最好方法是从their official website下载node.js,它也会安装npm。

相关问题