**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
This is possibly due to the dev package which gets installed with npm and this problem generally occurs with Mac OS.
Run the below command to remove the dev package.
npm uninstall dev --save
I hope I'm able to help with this answer.
I got the same error using nom, but I tried with Yarn, it worked.
$ 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
But then I tried with yarn
$ yarn add --dev jest
This might not have fix the problem with npm but it fixed this error for me
Below command worked for me.
sudo npm -g uninstall dev --save
More details on uninstalling npm package can be found here : How to uninstall npm modules in node js?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.