When installing using npm i -g pm2 it fails on the fsevent package. The fsevent package is a darwin platform only.
No previous install. Just installing fails.
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
Terminate batch job (Y/N)? y
pm2 is not installed so no reports etc.
Update: I am using npm version 6.0.1
I have tracked the problem down to chockidar. It has the dependency fsevents. It is marked in the package.json as optional.
"optionalDependencies": {
"fsevents": "^1.1.2"
},
However this is ignored by npm when installing and is still downloaded. This fails and causes the installation of pm2 to fail.
Any suggestions on a way around this?
Work around found!
Install chockidar by itself. It correctly spots that the installation is optional. When you then install pm2 it then works as the package causing the issue is already correctly installed.
@homerjonathan
I have faced same problem when 1st time installed Angular CLI with having node 1.x and npm 5.5.x but it can be resolved by setting class path for npm like below. I am hoping that it is helping to any one of us. path = C:Usersmadhavarao.mAppDataRoamingnpm
Regards,
_Rao_
Adding "fsevents": "*" under "devDependencies" followed by "npm i -f" resolved my issue.
Most helpful comment
Adding "fsevents": "*" under "devDependencies" followed by "npm i -f" resolved my issue.