繁体   English   中英

如何解决“inotify@1.4.2 平台不支持”

[英]How to solve “Unsupported platform for inotify@1.4.2”

**npm ERR!** code EBADPLATFORM
**npm ERR!** notsup Unsupported platform for inotify@1.4.2: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"})

**npm ERR!** notsup Valid OS:    linux
**npm ERR!** notsup Valid Arch:  any
**npm ERR!** notsup Actual OS:   darwin
**npm ERR!** notsup Actual Arch: x64

这可能是由于与 npm 一起安装的 dev 包,这个问题通常发生在 Mac OS 上。

运行以下命令以删除 dev 包。

npm uninstall dev --save

我希望我能够帮助回答这个问题。

我使用 nom 遇到了同样的错误,但我尝试使用 Yarn,它奏效了。

$ npm i dev jest
  npm WARN deprecated istanbul-lib-hook@1.2.1: 1.2.0 should have been a major version bump
  npm ERR! code EBADPLATFORM
  npm ERR! notsup Unsupported platform for inotify@1.4.2: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"})
  npm ERR! notsup Valid OS:    linux
  npm ERR! notsup Valid Arch:  any
  npm ERR! notsup Actual OS:   darwin
  npm ERR! notsup Actual Arch: x64

但后来我尝试用纱线

$ yarn add --dev jest

这可能没有解决 npm 的问题,但它为我解决了这个错误

下面的命令对我有用。

sudo npm -g uninstall dev --save

可以在此处找到有关卸载 npm 包的更多详细信息: 如何在节点 js 中卸载 npm 模块?

暂无
暂无

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

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