npm安装失败,显示一堆ERR报错


前言

  npm安装失败,显示一堆ERR报错,已解决,如有错误,请纠正,万分感谢


报错

在这里插入图片描述

C:\>npm install -g @vue/cli
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path C:\Program Files\nodejs\node_cache\_cacache\tmp\af6aab31
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\af6aab31'
npm ERR!  [OperationalError: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\af6aab31'] {
    
    
npm ERR!   cause: [Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\af6aab31'] {
    
    
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'open',
npm ERR!     path: 'C:\\Program Files\\nodejs\\node_cache\\_cacache\\tmp\\af6aab31'
npm ERR!   },
npm ERR!   isOperational: true,
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'open',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_cache\\_cacache\\tmp\\af6aab31'
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.

解决方法

查找了原因,原来是没有开启管理员权限。
惠普笔记本 win +X,再以管理员身份打开
在这里插入图片描述
在打开的窗口输入安装语句,即可成功!
在这里插入图片描述


疫情加重了,带好口罩,sincerely,end.

猜你喜欢

转载自blog.csdn.net/lavender_dream/article/details/112426462