12

When I run "npm install", I get an error.

OS: Windows 10 npm: 6.2.0 node: v10.9.0

I already tried to "npm install" after "npm cache verify" but I couldn't solved it.

npm cache verify 
npm instal

npm ERR! path C:\Users\ipiag\products\tor\src\node_modules.node-sass.DELETE\vendor\win32-x64-57\binding.node npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\ipiag\products\tor\src\node_modules.node-sass.DELETE\vendor\win32-x64-57\binding.node' npm ERR! { [Error: EPERM: operation not permitted, unlink 'C:\Users\ipiag\products\tor\src\node_modules.node-sass.DELETE\vendor\win32-x64-57\binding.node'] npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\ipiag\products\tor\src\node_modules.node-sass.DELETE\vendor\win32-x64-57\binding.node' npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR!
'C:\Users\ipiag\products\tor\src\node_modules\.node-sass.DELETE\vendor\win32-x64-57\binding.node' }, npm ERR!
stack:
npm ERR! 'Error: EPERM: operation not permitted, unlink \'C:\Users\ipiag\products\tor\src\node_modules\.node-sass.DELETE\vendor\win32-x64-57\binding.node\'', npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path:
npm ERR!
'C:\Users\ipiag\products\tor\src\node_modules\.node-sass.DELETE\vendor\win32-x64-57\binding.node', npm ERR! parent: 'tor' }
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 (though this is not recommended).

                                                                                                                                                                              npm ERR! A complete log of this run can be found in:                  

npm ERR!
C:\Users\ipiag\AppData\Roaming\npm-cache_logs\2019-06-12T02_32_33_624Z-debug.log

1
  • 1
    Try removing the node_modules folder. Then npm install instead of npm instal.
    – Super Jade
    Commented Jun 12, 2019 at 4:54

4 Answers 4

36

In my case, i killed all nodejs running processes and it worked.

2
  • Yep, same goes for if you are running React. I stopped it and it installed fine. Commented Apr 20, 2021 at 17:05
  • This worked for me. There were "node" processes in windows and I manually end them and it worked.
    – Jim.B
    Commented Sep 18, 2021 at 10:43
9

This usually happens when you are running node and then try to do an npm install in your project.

Check if you are running gulp like gulp build:server or any npm scripts (like npm run xxxx) for your project. Then stop those and you will be able to successfully complete npm install command.

1
  • Killed all node tasks from Task Manager(Windows 10) and then again executed the commands. It worked! Commented Sep 21, 2020 at 12:25
1

I had the same problem, I manually removed .node-sass.DELETE from node_modules

Then run:

npm cache verify

npm install
1

On Windows, closing Node wasn't enough.

I had to open a shell in Admin Mode and stop all Node and Electron processes.

Here are the four apps I know can lock some files in node_modules directories

stop-process -Name node
stop-process -Name electron
stop-process -Name chromedriver
stop-process -Name chrome          # ChromeDriver can spawn some apps during tests in hidden mode

Not the answer you're looking for? Browse other questions tagged or ask your own question.