【发布时间】:2019-11-14 23:01:34
【问题描述】:
这里是菜鸟,我正在尝试使用 bash 终端安装 npm 模块并用作 Remote-WSL 终端。
一些背景信息,我使用 VSCode 作为我的代码编辑器。我正在尝试使用 node.js 制作一个 JavaScript 应用程序。我在 Windows 10 上设置了 Ubuntu 终端。
将 npm 更新到最新版本后,我在尝试使用 npm install express --save 安装 express 时开始收到这些错误
npm WARN tar EPERM: operation not permitted, futime
npm WARN tar EPERM: operation not permitted, futime
npm WARN tar EPERM: operation not permitted, futime
// etc, etc, etc 500x...
npm WARN bashdemo@1.0.0 No description
npm WARN bashdemo@1.0.0 No repository field.
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /mnt/d/Program Files/Workspace/bashDemo/node_modules/bytes
npm ERR! dest /mnt/d/Program Files/Workspace/bashDemo/node_modules/.bytes.DELETE
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/mnt/d/Program Files/Workspace/bashDemo/node_modules/bytes' -> '/mnt/d/Program Files/Workspace/bashDemo/node_modules/.bytes.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/aaron/.npm/_logs/2019-11-14T21_41_32_512Z-debug.log
无论我尝试安装什么模块,此问题都存在......
即使在恢复到正常工作的 npm 的原始版本 6.12.1 后,这些错误仍然存在。
如果我运行 npm install 我会得到
npm WARN bashdemo@1.0.0 No description
npm WARN bashdemo@1.0.0 No repository field.
up to date in 0.636s
found 0 vulnerabilities
我尝试清除缓存、重置、卸载、关闭/打开 linux 子系统、每次重新启动计算机、重新安装 Ubuntu,然后完成设置过程、更新、升级、使用 github 上的 curl 脚本安装 nvm页面现在大约 3 倍。
我尝试按照先前报告的类似问题的指南卸载并重新安装我的 /mnt/c/。这只会让事情变得更糟,(提示重置并重新安装 Ubuntu 终端)。
【问题讨论】:
-
不确定是否是同一件事,但这对我有帮助:stackoverflow.com/a/58414196/861835
-
我之前尝试过这个,但结果是我在之前卸载 node 以运行 node 的全新安装时不知何故错过了将 node 重新安装回我的 windows 机器的步骤。
标签: node.js bash npm windows-subsystem-for-linux nvm