node EPERM: operation not permitted报错解决方法

问题描述:最近将node版本升级到v8.9.1之后,运行命令npm install老报错 Error: EPERM: operation not permitted

$ npm install vue-amap --save

npm ERR! path E:\testProject\vueYue\node_modules\fsevents\node_modules\dashdash\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir 'E:\testProject\vueYue\node_modules\fsevents\node_modules\dashdash\node_modules'
npm ERR!  { Error: EPERM: operation not permitted, scandir 'E:\testProject\vueYue\node_modules\fsevents\node_modules\dashdash\node_modules'
npm ERR!   stack: 'Error: EPERM: operation not permitted, scandir \'E:\\testProject\\vueYue\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'scandir',
npm ERR!   path: 'E:\\testProject\\vueYue\\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\Administrator\.nodejs\node_global\_logs\2017-12-01T07_13_31_117Z-debug.log

最终解决方案:以管理员身份运行cmd


image.png

参考:http://blog.csdn.net/zhangshufei8001/article/details/51777370

你可能感兴趣的:(node EPERM: operation not permitted报错解决方法)