npm - 如何解决 install -g yarn 上的 npm 错误?
问题描述
我想运行这个命令并安装纱线
npm install -g yarn
但我得到这个错误
npm ERR! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\DigiMax\AppData\Roaming\npm\node_modules\yarn
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
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! C:\Users\DigiMax\AppData\Local\npm-cache\_logs\2021-07-03T15_03_24_683Z-debug.log
我怎么解决这个问题?
解决方案
最快的解决方案npm cache clean
在npm cache verify
大多数情况下都有效。
根据docs.npmjs,您应该检查您的 npm 版本并在需要时进行更新,或者在最坏的情况下重新安装它。
请让我们知道它是否有效
推荐阅读
- android - Andorid Here Maps:致命信号 11 (SIGSEGV),代码 1 (SEGV_MAPERR),
- rust - 我可以在 Rocket 中使用异步 fn 作为处理程序吗?
- javascript - React-Intl:带数组的 I18n
- javascript - 单击导航栏中的“a”元素会卡在触摸模式下,但可以正常工作
- opencv - opencv4android的相机焦点
- javascript - 数组连接问题
- python - dnspython 中的服务器名称可达性
- google-chrome - 从 VM 到本地计算机的 IndexedDB 副本
- javascript - 在触发来自代码隐藏的页面加载事件之前,如何在页面加载时将会话存储值传递到文本框中
- sparql - 这些使用 sh:or 的形状图有什么区别?