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文件的权限改一下。右键-属性-安全

问题就解决了。

相关推荐
1024奇点8 小时前
【仓颉语言入门 · 第二篇 第 8 课】
开发语言·数据库·ide·mysql·开源
xiaoye-duck9 小时前
《C++ 项目:手写大模型接入 SDK》Trae IDE 开发环境搭建与依赖管理
c++·ide·语言模型
天若有情67310 小时前
POT规范|一套个人自研NPM包本地生命周期管理体系
npm·包管理·前端工程化·个人开源·工程规范·pot规范
一只笨菜鸟10 小时前
IDEA如何让多个项目同时显示
java·ide·intellij-idea
哎写bug的程序员1 天前
关于VSCode上gcc,gdb的安装配置问题
ide·vscode·编辑器
旺旺的碎冰冰~1 天前
VScode解决终端输出中文乱码问题
ide·vscode·编辑器
jason.zeng@15022071 天前
使用vscode+flutter开发android程序(入门)
android·vscode·flutter
devilnumber2 天前
避坑_IDEA 提取方法(Extract Method)工具
java·ide·intellij-idea
golang学习记2 天前
最新版VS Code开发Spring Boot项目保姆级教程
java·spring boot·vscode·后端
kiracrimson2 天前
npm 入门:包管理器、依赖与 npx
前端·npm·node.js