![](/img/trans.png)
[英]Unsupported platform for inotify@1.4.1: wanted {“os”:“linux”,“arch”:“any”}
[英]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 的問題,但它為我解決了這個錯誤
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.