"npm ERR! Error: EPERM: operation not permitted"问题解决

错误:Unhandled rejection Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\

 

Windows系统下npm 运行vue-cli创建项目时报错:


npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "uninstall" "express" "-g"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! path C:\Program Files\nodejs\node_cache\_locks
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall mkdir
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache\_locks'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache\_locks'
npm ERR!     at Error (native)
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_cache\\_locks' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\admin\npm-debug.log
 

 

重点是:operation not permitted  想到应该是windows系统下的权限错误。

 

解决方法:   使用win+x,选择命令提示符(管理员),在里面运行命令就好了。

 

 

 

你可能感兴趣的:(vue)