簡體   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