When I tried to run npm install, it gave me this error:
$ npm install npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! notsup Valid OS: darwin npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: win32 npm ERR! notsup Actual Arch: x64 npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Aroma\AppData\Roaming\npm-cache\_logs\2018-03- 25T11_33_58_338Z-debug.log The node version:
$node -v v8.10.0 I tried every thing, like:
npm cache clear npm cache verify npm i -g npm@latest I even tried uninstalling and reinstalling Nodejs again but still get the same error.
14 Answers
I had the same issue, deleting my "package-lock.json" and re-running npm install worked
For those having issue on render.com
- remove
package-lock.jsonfrom your repo or add togitignore - then run the build command
npm install ; npm run buildusing the build from last comment option onrender.com dashboard
Error is indicating that you are installing fsevents module in other OS rather than Mac
fsevents module only works for Mac Operting system
This worked effortless for me on Windows:
- Go to project's "package-lock.json" file.
- Press "Ctrl+F" (to enable keyword search).
- Type "darwin".
- Wherever it says "darwin" in the file, change that to "win32".
Restart your VS Code and you should be good to go.
4Add following to your project's package.json
"optionalDependencies": { "fsevents": "*" }, and then install with --no-optional
1Same npm install error (code EBADPLATFORM):
I had forced fsevents onto my windows machine npm i -f fsevents... npm responded "I hope you know what your doing".
To repair, needed to
- delete package-lock.json
- delete line: [email protected] in package.json (your suffix may differ)
- re-ran npm install
Remove "fsevents": "version", on package.json if you try to install on Windows.
I'm developing on Mac. I deleted "os": [ "darwin" ] from package.lock.json, ran the build, deployed to my Google Cloud App Engine project, and it finally worked.
Source: belykh's comment (Nothing posted in any of the other answers helped me.)
The error says it all:
Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) This module doesn't support Windows, you can't use it if you're on Windows.
1I think In your Project Folder First Delete package.lock.json and then try:
npm install This is Works For Me.
I had this same issue on my dev machine (Win 10 x64). I had no intention of running or using fsevents locally. I just needed to upgrade my local copy of fsevents, to resolve a vulnerability. Running with the -f option solved it:
npm install [email protected] -f Note: -f means "force installation". npm gives an ominous warning like "I hope you know what you're doing". Afaik fsevents isn't dangerous to have on a win32 machine. It only "works" on mac. The npm page for fsevents says "This is a low-level library. For a cross-platform file watching module that uses fsevents, check out Chokidar". I was only upgrading and wasn't choosing to use it on a win32 machine. So keep that in-mind.
That being-said, it didn't break anything for me. No BSoDs, errors, etc. App still works. Build works. All good.
This error message says that fsevents package does not support your operating system. In my case the solution for this error was to upgrade npm to the latest version.
please first delete package-lock.json file and remove "win-node-env": "^0.4.0" this line from package.json
This is what worked for me:
- Delete node_modules
- Delete package-lock.json
- run
npm i
Add peer dependency in your JSON package like below
{ "name": "chai-as-promised", "peerDependencies": { "chai": "1.x" } }