运行npm install时报错如下:
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'scandir',
npm ERR! path: 'E:\\SouthernPowerGridProject\\web_project\\AutoOPS\\autoops\\node_modules\\fsevents\\node_modules\\dashdash\\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\ThinkT420\AppData\Roaming\npm-cache\_logs\2017-10-30T06_50_38_610Z-debug.log
根据提示,以管理员身份运行,有时候这个方法好使,有时候也不太好使,这里介绍两种方法来解决这个问题:
1、删除npmrc文件
npmrc文件的位置:C:\Users\{账户}\.npmrc
删除即可
2、直接用命令清理
控制台输入:
npm cache clean --force
此时控制台是这样的
PS D:\projects\my-test> npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
这时候再执行npm install
npm install
报错消失