npm - EPERM operation not permitted on Windows

PS C:\Dev\Project\test.com\StyleGuide> npm install smart-app-banner --save-dev
npm ERR! path C:\Dev\Project\test.com\StyleGuide\node_modules\fsevents\node_modules\getpass\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir 'C:\Dev\Project\test.com\StyleGuide\node_modules\fsevents\node_modules\getpass\node_modules'
npm ERR!  { Error: EPERM: operation not permitted, scandir 'C:\Dev\Project\test.com\StyleGuide\node_modules\fsevents\node_modules\getpass\node_modules'
npm ERR!   stack: 'Error: EPERM: operation not permitted, scandir \'C:\\Dev\\Project\\test.com\\StyleGuide\\node_modules\\fsevents\\node_modules\\getpass\\node_modules\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'scandir',
npm ERR!   path: 'C:\\Dev\\Project\\test.com\\StyleGuide\\node_modules\\fsevents\\node_modules\\getpass\\node_modules' }
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\username\AppData\Roaming\npm-cache\_logs\2018-03-23T00_14_22_090Z-debug.log
PS C:\Dev\Project\test.com\StyleGuide> npm config edit
PS C:\Dev\Project\test.com\StyleGuide> npm start
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\username\AppData\Roaming\npm-cache\_logs\2018-03-23T00_19_24_410Z-debug.log

Solution

 

Running this command was my mistake.

npm install smart-app-banner --save-dev

Path /usr/local is not for windows. This command changed the prefix variable at 'C:\Program Files (x86)\Git\local'

To access and make a change to this directory I need to run my cmd as administrator.

So I did:

  1. Run cmd as administrator
  2. Run npm config edit (You will get notepad editor)
  3. Change Prefix variable to C:\Users\<User Name>\AppData\Roaming\npm

Then npm install smart-app-banner --save-dev works in a normal console.

Share item with friends