npm - 在 WSL 上安装包时出现 EACCESS 错误
问题描述
我在尝试从 VS Code 对 WSL 上的 NPM INSTALL 包进行 NPM INSTALL 包时遇到此错误。
npm ERR! Error: EACCES: permission denied, rename '/mnt/d/DEVRepo/PWS/functions/node_modules/cssstyle' -> '/mnt/d/DEVRepo/PWS/functions/node_modules/.cssstyle.DELETE'
npm ERR! [OperationalError: EACCES: permission denied, rename '/mnt/d/DEVRepo/PWS/functions/node_modules/cssstyle' -> '/mnt/d/DEVRepo/PWS/functions/node_modules/.cssstyle.DELETE'] {
npm ERR! cause: [Error: EACCES: permission denied, rename '/mnt/d/DEVRepo/PWS/functions/node_modules/cssstyle' -> '/mnt/d/DEVRepo/PWS/functions/node_modules/.cssstyle.DELETE'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/mnt/d/DEVRepo/PWS/functions/node_modules/cssstyle',
npm ERR! dest: '/mnt/d/DEVRepo/PWS/functions/node_modules/.cssstyle.DELETE'
npm ERR! },
npm ERR! stack: "Error: EACCES: permission denied, rename '/mnt/d/DEVRepo/PWS/functions/node_modules/cssstyle' -> '/mnt/d/DEVRepo/PWS/functions/node_modules/.cssstyle.DELETE'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/mnt/d/DEVRepo/PWS/functions/node_modules/cssstyle',
npm ERR! dest: '/mnt/d/DEVRepo/PWS/functions/node_modules/.cssstyle.DELETE',
npm ERR! parent: 'functions'
npm ERR! }
解决方案
问题是 VSCode WSL 扩展锁定文件并产生错误。
解决方案是关闭 VSCode 上的 WSL 连接 o 只需关闭整个 IDE 并再次运行 npm install 命令。
推荐阅读
- c++ - 创建一个棋盘格或“交织”两个链表。IE改变两个链表的指针
- python - 如何显示熊猫列模糊?
- c# - 找不到包裹***。源中不存在具有此 ID 的包:“Local Nuget”、Microsoft Visual Studio 脱机包、nuget.org
- python - 帧中的背景检测
- java - 如何在 Kotlin 中获取 Java 原始 void 类?
- django - Django 在每个视图中显示消息
- c++ - C++ condition_variable wait_for() 永远阻塞
- windows - VBScript Windows 自动登录脚本
- spring - Spring Boot 2 MongoDB @TypeAlias 不起作用
- c# - 固定包含非 blitable 类型的结构数组 c#