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

问题就解决了。

相关推荐
Gene_20226 小时前
ubuntu22.04在vscode使用codex
ide·vscode·编辑器
sinat_255487818 小时前
IDEA:查找文件/类
java·ide·设计模式·intellij-idea
Tiger Z9 小时前
Positron 教程4 --- 数据分析
ide·编程·positron
lqqjuly9 小时前
vscode+remote-ssh+claude code+mimo-v2.5配置
ide·vscode·编辑器
打小就很皮...12 小时前
基于 Python + LangChain + React 实现前端项目生成器
前端·人工智能·react.js·langchain·npm
MrXun_13 小时前
vscode中同时连接多个远程并同时登录使用codex
ide·vscode·编辑器·codex
李白的天不白15 小时前
VSCODE 配置文件的方法
ide·vscode·编辑器
菜鸟是大神15 小时前
03-替换DeepSeek模型和VSCode中的使用
ide·vscode·编辑器
2501_9159214316 小时前
Xcode与iOS SDK完整教程:从下载安装到配置优化全解析
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
xcs1940516 小时前
idea 升级版本问题 21---》25,26
java·ide·intellij-idea