Home > Software engineering >  npm ERR! Error: EPERM: sysCall: 'RENAME', Operation not permitted
npm ERR! Error: EPERM: sysCall: 'RENAME', Operation not permitted

Time:02-27

When I execute npm install I get the following error:

npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\Vaneeza10698\Downloads\ServiceQualityFinal\react-reduction\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate
npm ERR! dest C:\Users\Vaneeza10698\Downloads\ServiceQualityFinal\react-reduction\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Vaneeza10698\Downloads\ServiceQualityFinal\react-reduction\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\Vaneeza10698\Downloads\ServiceQualityFinal\react-reduction\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate'
npm ERR!  { [Error: EPERM: operation not permitted, rename 'C:\Users\Vaneeza10698\Downloads\ServiceQualityFinal\react-reduction\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\Vaneeza10698\Downloads\ServiceQualityFinal\react-reduction\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, rename 'C:\Users\Vaneeza10698\Downloads\ServiceQualityFinal\react-reduction\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\Vaneeza10698\Downloads\ServiceQualityFinal\react-reduction\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'rename',
npm ERR!      path:
npm ERR!       'C:\\Users\\Vaneeza10698\\Downloads\\ServiceQualityFinal\\react-reduction\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@tootallnate',
npm ERR!      dest:
npm ERR!       'C:\\Users\\Vaneeza10698\\Downloads\\ServiceQualityFinal\\react-reduction\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@tootallnate' },
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, rename \'C:\\Users\\Vaneeza10698\\Downloads\\ServiceQualityFinal\\react-reduction\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@tootallnate\' -> \'C:\\Users\\Vaneeza10698\\Downloads\\ServiceQualityFinal\\react-reduction\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@tootallnate\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path:
npm ERR!    'C:\\Users\\Vaneeza10698\\Downloads\\ServiceQualityFinal\\react-reduction\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@tootallnate',
npm ERR!   dest:
npm ERR!    'C:\\Users\\Vaneeza10698\\Downloads\\ServiceQualityFinal\\react-reduction\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@tootallnate',
npm ERR!   parent: 'npm' }
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\Vaneeza10698\AppData\Roaming\npm-cache\_logs\2022-02-22T06_28_43_606Z-debug.log

I have done the following so far and still no result

  • Deleted node_modules and package-lock.json file
  • npm cache clean --force
  • npm install --force
  • Delete node and npm and installed again.
  • Reboot the system
  • Check permissions
  • Turn off firewall
  • Run cmd as administrator

Node version: 10.23.0 NPM Version: 6.14.8

Any help will be appreciated.

CodePudding user response:

I would try running it on another drive/partition. In the past regardless of my permission set sometimes Windows likes to restrict certain operations such as file name changes even if it's supposed to be allowed in a certain folder. If that doesn't work then try on another computer to see if the problem is related with the system environment or not.

CodePudding user response:

Deleting my node_modules and reinstalling all my used packages helped me fix this error.

  • Related