使用npm 安装vue的时候突然报错了,找了半天只有让清缓存 !终于解决!
报错如下
npm ERR! code EPERM npm ERR! syscall mkdir npm ERR! path C:\Program Files\nodejs\node_cache\_cacache npm ERR! errno -4048 npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache\_cacache' npm ERR! [OperationalError: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache\_cacache'] { npm ERR! cause: [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache\_cacache'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'C:\\Program Files\\nodejs\\node_cache\\_cacache' npm ERR! }, npm ERR! isOperational: true, npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'C:\\Program Files\\nodejs\\node_cache\\_cacache' npm ERR! } 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.
解决方法:
Win10怎么以管理员身份运行CMD命令提示符
首先:我们可以在Windows10系统的开始菜单上,单击鼠标右键,或者(开始菜单键+x)这时候出现的菜单中,我们选择命令提示符(管理员)点击打开这样即可。
在管理员的身份下执行命令清理就行,控制台输入下方命令:npm cache clean --force ,再执行安装即可。