vscode终端npm install报错

报错如下:

复制代码
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best 
with it!
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'E:\NODEJS\node_cache\_cacache\tmp\c606bc49'
npm ERR!  [OperationalError: EPERM: operation not permitted, open 'E:\NODEJS\node_cache\_cacache\tmp\c606bc49'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, open 'E:\NODEJS\node_cache\_cacache\tmp\c606bc49'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'open',
npm ERR!     path: 'E:\\NODEJS\\node_cache\\_cacache\\tmp\\c606bc49'
npm ERR!   },
npm ERR!   isOperational: true,
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'open',
npm ERR!   path: 'E:\\NODEJS\\node_cache\\_cacache\\tmp\\c606bc49'
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.

最后一句:

复制代码
npm ERR! the command again as root/Administrator.

说明是权限问题。

把nodejs文件的权限改一下。右键-属性-安全

问题就解决了。

相关推荐
任磊abc11 小时前
vscode无法检测到typescript环境解决办法
ide·vscode·typescript
hfut028811 小时前
【vscode使用说明】
vscode·编辑器·vim
海上彼尚12 小时前
使用 npm-run-all2 简化你的 npm 脚本工作流
前端·npm·node.js
weixin_3077791314 小时前
VS Code配置MinGW64编译GNU 科学库 (GSL)
开发语言·c++·vscode·算法
ala咪16 小时前
切换VSCODE 中的默认 shell
vscode
BIBI204916 小时前
自定义 VSCode 标题栏以区分不同版本
ide·vscode·编辑器
:-)18 小时前
idea配置maven国内镜像
java·ide·maven·intellij-idea
HWL567919 小时前
pnpm(Performant npm)的安装
前端·vue.js·npm·node.js
谱写秋天1 天前
Qt 5.5 的安装与配置(使用 VSCode编辑)
开发语言·vscode·qt
骑着毛驴数星星2 天前
CANDB++中的CAN_DBC快速编辑方法,使用文本编辑器(如notepad++和VScode)
vscode·can