繁体   English   中英

npm 不在 WSL 上安装包

[英]npm not installing packages on WSL

我一直遇到 npm 未安装软件包的问题。

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /mnt/c/Users/zhelf/downloads/test/node_modules/ansi-regex
npm ERR! dest /mnt/c/Users/zhelf/downloads/test/node_modules/.ansi-regex.DELETE
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/mnt/c/Users/zhelf/downloads/test/node_modules/ansi-regex' -> '/mnt/c/Users/zhelf/downloads/test/node_modules/.ansi-regex.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/zhelf/.npm/_logs/2020-08-05T16_06_33_155Z-debug.log

这是它一直给我的错误我正在运行带有 WSL 的 windows 10 和 ubuntu 20.04 我也尝试通过常规终端和 vscode 中的终端。 我试过用谷歌搜索这个问题已经清除了 npm 缓存,我遇到了同样的问题,我试图安装 express,但也尝试了其他软件包,但我一直收到同样的错误。

好的,我发现我需要运行npm install -g build-tools和 package 再次安装它的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM