0

When I clone my angular project and run "npm install" for installing all dependencies in node_module I face with this error:

npm ERR! path D:\Project\VipUi\angular\node_modules\.staging\echarts-25586c04\map\js\world.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall lstat
npm ERR! Error: EPERM: operation not permitted, lstat 'D:\Project\VipUi\angular\node_modules\.staging\echarts-25586c04\map\js\world.js'
npm ERR!  { [Error: EPERM: operation not permitted, lstat 'D:\Project\VipUi\angular\node_modules\.staging\echarts-25586c04\map\js\world.js']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, lstat 'D:\Project\VipUi\angular\node_modules\.staging\echarts-25586c04\map\js\world.js'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'lstat',
npm ERR!      path:
npm ERR!       'D:\\Project\\VipUi\\angular\\node_modules\\.staging\\echarts-25586c04\\map\\js\\world.js' },
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, lstat \'D:\\Project\\VipUi\\angular\\node_modules\\.staging\\echarts-25586c04\\map\\js\\world.js\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'lstat',
npm ERR!   path:
npm ERR!    'D:\\Project\\VipUi\\angular\\node_modules\\.staging\\echarts-25586c04\\map\\js\\world.js',
npm ERR!   parent: 'angular' }
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).

and I try to get node_module of my teammate and copy it in my project I get the loader.js error in my powershell

internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'D:\Project\VipUi\angular\node_modules\@angular\cli\bin\ng'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

how can I resolve this problem?

hosein
  • 139
  • 1
  • 4
  • 14

1 Answers1

0

npm - EPERM: operation not permitted on Windows

  1. Run cmd as administrator

  2. Run npm config edit (You will get notepad editor)

  3. Change prefix variable to C:\Users\\AppData\Roaming\npm

Chanaka Weerasinghe
  • 5,404
  • 2
  • 26
  • 39