Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm error unsupported platform for fsEvents when deploying to Azure

Tags:

When I run npm install, I get this error:

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 

This has been asked here but the accepted answer that it is optional does not work for me as I am unable to publish to azure since npm install fails.

npm version : 5.6.0

I have tried:

npm install --no-optional 
like image 280
Curious-programmer Avatar asked Feb 21 '18 04:02

Curious-programmer


People also ask

What is FSEvents NPM?

The FSEvents API in MacOS allows applications to register for notifications of changes to a given directory tree. It is a very fast and lightweight alternative to kqueue.

How force NPM install?

The -f or --force argument will force npm to fetch remote resources even if a local copy exists on disk. The -g or --global argument will cause npm to install the package globally rather than locally.

What is the NPM latest version?

16.0.0 or higher.


2 Answers

npm i -f doesn't sound like a good idea...

Instead, add fsevents to optional dependencies (if fsevents is in your package.json):

"optionalDependencies": {     "fsevents": "^2.0.7" } 
like image 54
Benjamin Piette Avatar answered Sep 26 '22 03:09

Benjamin Piette


@Aaron is correct. This was failing when I was running npm install from within maven-frontend-plugin.

I resolved the issue using the command npm i -f ( npm install forced)

like image 43
Oliver Avatar answered Sep 23 '22 03:09

Oliver