Error: EPERM: operation not permitted, unlink 'D:\Sources\**\node_modules\fsevents\node_modules\abbrev\package.json'

I was able to fix this by running the command prompt/bash as admin and closing VSCode! Seems like VSCode was locking some files. Potentially something else could be locking these files for you.


It is an npm 5.4.0 issue https://github.com/npm/npm/issues/18287

Workarounds are

  • downgrade to 5.3
  • try running with --no-optional, i.e. npm install --no-optional

If you downgrade to 5.3 and still get the same error in Windows like me.
After hours working with npm versions I found the following solution:

1. Download latest recommended version of nodejs, these days is node-v6.11.3-x64
2. Uninstall nodejs with it.
3. Go to C:\Users\{YourUsername}\AppData\Roaming folder and delete npm and npm-cache folders
4. Run installer of nodejs again and install it
5 Update npm to 5.3 with npm i -g [email protected] command line

Now you should use npm without any issues.