【发布时间】:2020-03-28 00:32:09
【问题描述】:
当我克隆我的 Angular 项目并运行“npm install”以在 node_module 中安装所有依赖项时,我遇到了这个错误:
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).
我尝试获取队友的 node_module 并将其复制到我的项目中,但我的 powershell 中出现 loader.js 错误
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)
我该如何解决这个问题?
【问题讨论】:
标签: node.js angular npm-install