1
votes

I'm using npm for a long time (using win 10) - didn't change any thing in firewall/permissions etc. and all of a sudden I get the following error while trying to install any package:

C:\udemy-button>npm install bootstrap --save npm ERR! path C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json' npm ERR! at Error (native) npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json' npm ERR! at Error (native) npm ERR! stack: 'Error: EPERM: operation not permitted, unlink \'C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json\'\n at Error (native)', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json' } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\Roy Barak\AppData\Roaming\npm-cache_logs\2017-09-05T13_12_42_361Z-debug.log

I've also tried to open CMD with admin privileges and run the npm from there - but i got the same error - enter image description here

I've done the following steps :

  1. Clean npm cache
  2. Check for folder permissions
  3. Reinstall Node
  4. Restart my machine

Here is the log file - only the last part which related to the error

1569 silly doParallel preinstall 894 1570 silly preinstall [email protected] 1571 info lifecycle [email protected]~preinstall: [email protected] 1572 silly doSerial build 894 1573 silly build [email protected] 1574 info linkStuff [email protected] 1575 silly linkStuff [email protected] has C:\udemy-button\node_modules as its parent node_modules 1576 verbose linkBins [email protected] 1577 verbose linkMans [email protected] 1578 silly doSerial global-link 894 1579 silly doParallel update-linked 894 1580 silly doSerial install 894 1581 silly install [email protected] 1582 info lifecycle [email protected]~install: [email protected] 1583 silly doSerial postinstall 894 1584 silly postinstall [email protected] 1585 info lifecycle [email protected]~postinstall: [email protected] 1586 verbose unlock done using C:\Users\Roy Barak\AppData\Roaming\npm-cache_locks\staging-e7bff0426a609d7b.lock for C:\udemy-button\node_modules.staging 1587 verbose stack Error: EPERM: operation not permitted, unlink 'C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json' 1587 verbose stack at Error (native) 1588 verbose cwd C:\udemy-button 1589 verbose Windows_NT 10.0.15063 1590 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\Roy Barak\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "bootstrap" 1591 verbose node v6.11.2 1592 verbose npm v5.4.0 1593 error path C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json 1594 error code EPERM 1595 error errno -4048 1596 error syscall unlink 1597 error Error: EPERM: operation not permitted, unlink 'C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json' 1597 error at Error (native) 1597 error { Error: EPERM: operation not permitted, unlink 'C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json' 1597 error at Error (native) 1597 error stack: 'Error: EPERM: operation not permitted, unlink \'C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json\'\n at Error (native)', 1597 error errno: -4048, 1597 error code: 'EPERM', 1597 error syscall: 'unlink', 1597 error path: 'C:\udemy-button\node_modules\fsevents\node_modules\aws4\package.json' } 1598 error Please try running this command again as root/Administrator. 1599 verbose exit [ -4048, true ]

2
Did you try doing what it tells you to do? Please try running this command again as root/Administrator.Sasha
Yeah.. i opened cmd with admin privileges and tried - same error - UPDATERoyBarOn
"A complete log of this run can be found in: npm ERR! C:\Users\Roy Barak\AppData\Roaming\npm-cache_logs\2017-09-05T13_12_42_361Z-debug.log" Can you post that file?Paul
Paul - thanks - updatedRoyBarOn

2 Answers

1
votes

This is also an issue with npm 5 and was introduced with [email protected], see github issue.

If you're using npm v5, you can downgrade to [email protected]:

npm i -g [email protected]
0
votes

Fixed it by downgrading NPM:

> npm i -g npm@latest-2
[email protected]
added 73 packages, removed 282 packages and updated 129 packages in 36.697s

> npm -v
2.15.12