npm operation not permitted, rename
Today the builds in two projects started to fail with npm errors:
npm -g install npm
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate
npm ERR! dest C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate'
npm ERR! [OperationalError: EPERM: operation not permitted, rename 'C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\node_modules\@tootallnate'] {
npm ERR! cause: [Error: EPERM: operation not permitted, rename 'C:\Users\appveyor\AppData\Roaming\npm\node_modules\npm\node_modules\.node-gyp.DELETE\node_modules\@tootallnate' -> 'C:\Users\appveyor\AppData\Roaming\npm\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: 'C:\\Users\\appveyor\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@tootallnate',
npm ERR! dest: 'C:\\Users\\appveyor\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@tootallnate'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\appveyor\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\.node-gyp.DELETE\\node_modules\\@tootallnate',
npm ERR! dest: 'C:\\Users\\appveyor\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\node_modules\\@tootallnate',
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\appveyor\AppData\Roaming\npm-cache\_logs\2022-01-28T12_17_48_444Z-debug.log
Command exited with code -4048
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by dev on 28 Jan, 2022 02:32 PM
The solution was to remove the npm install from the beginning:
npm -g install npm
2 Posted by nbdevelop on 28 Jan, 2022 06:57 PM
I'm encountering the same issue and output as the above, with the error relating to the same package "node-gyp.DELETE\node_modules\@tootallnate"
- the above solution, simply removing the command, does not work (unless there is explanation missing)
- npm install builds successfully in the local environment
- I've tried moving 'npm install' to the install stage as mentioned in https://help.appveyor.com/discussions/problems/5290-npm-error-operation-not-permited-on-renaming-a-packagetgz
config is attached. Would appreciate any leads
3 Posted by nbdevelop on 28 Jan, 2022 07:02 PM
Wrongly included a modified yml above. The one causing error is attached below
Support Staff 4 Posted by Feodor Fitsner on 28 Jan, 2022 10:10 PM
@nbdevelop Are you running
npm -g install npm
as well?5 Posted by nbdevelop on 31 Jan, 2022 11:51 AM
I'm not running
npm -g install npm
. Only the contents of the yml file.Support Staff 6 Posted by Feodor Fitsner on 31 Jan, 2022 05:02 PM
You don't need to install Node with Chocolatey - it's already pre-installed on AppVeyor VMs. Try changing
appveyor.yml
to the following:Also, if it dosn't help you could try removing
package-lock.json
.7 Posted by nbdevelop on 31 Jan, 2022 07:23 PM
The above did not solve the problem, however I changed the install command to use 'ci' and removed our package-lock.json from gitignore (which I now understand is the correct way) and this solved the issue. Really appreciate the help - thank you!
Support Staff 8 Posted by Feodor Fitsner on 31 Jan, 2022 07:31 PM
Sounds great, thanks for the update!
Feodor Fitsner closed this discussion on 02 Apr, 2022 09:02 PM.