110

Testing binary Binary is fine npm WARN rollback Rolling back [email protected] failed (this is probably harmless):

EPERM: operation not permitted, lstat 'C:\Users\orca yoon\Documents\IonicProjects\starters\epic\node_modules\fsevents\node_modules'

npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1105 packages from 1050 contributors and audited 53269 packages in 445.94s found 1 high severity vulnerability run npm audit fix to fix them, or npm audit for details

1

13 Answers 13

47
  • First,

Run your command prompt or powershell as Administrator role. Then you'll get avoided with PERMISSION ERROR.

  • Second,

Ignore npm audit fix. It only suggests you to renovate all of your package.json dependencies up-to-date. You should preserve the settings clarified in package.json.

  • Third,

If you're working on ubuntu or OS X, you won't face this issue, I guess.


PS:

According to your reply, I'd like to think about the workaround.

  • Remove the local node_modules & package-lock.json
  • Clean npm cache by npm cache verify
  • Update the global npm by sudo npm i -g npm
  • Reinstall the local node_modules by npm i

Hope this might help.

7
  • 3
    Working on an ubuntu virtual machine got the same error . npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux Commented May 15, 2019 at 15:24
  • 1
    @KojiD'infinte I've updated the answer. Plz check the PS: below. Commented May 16, 2019 at 2:07
  • 22
    the above won't help. fsevents is MacOS only package and this warning won't get away, even if you will remove node_modules folder and reinstall. In my application (vue.js v2.6), this fsevents is a depency from fuse.js which is used for whatever thing. I've just got used to these warnings. Commented May 24, 2019 at 11:07
  • 6
    > "If you're working on ubuntu or OS X, you won't face this issue, I guess." What? Ubuntu is Linux, not Darwin, of course you will face the same issue!
    – mastazi
    Commented Jul 5, 2020 at 4:59
  • 2
    I'm using Ubuntu 20.04 and the PS worked fine to me
    – tarcnux
    Commented Mar 7, 2021 at 8:43
30

I found a solution, this is what I did:

Open your package-lock.json.

Find node_modules/fsevents, inside this there is something called "os", I had only this:

 "os": [
        "darwin",
      ],

So my OS is windows 10 64 bits I just added my OS inside "os", the result is this:

 "os": [
        "darwin",
        "win32"
      ],

then save and is solved, after doing this I could install the package I was trying to install that I couldn't.

3
  • 7
    This looks like a dirty hack but it's the only thing that solved it for me. Thanks
    – Kajuna
    Commented Jun 2, 2021 at 17:15
  • 3
    Same here, dirty as ever but I'm gonna take it and go lol
    – saricden
    Commented Nov 20, 2021 at 7:37
  • 2
    This was the least intrusive way I’ve found to fix this issue, and it works for Linux too. Cheers Victor, thank you!
    – gnclmorais
    Commented Jul 6, 2022 at 9:27
23

As I got into the issue just today I read the first solution but tried one thing first

Remove package-lock.json and node_modules dir first

Run these commands and it should work.

rm -rf node_modules package-lock.json
npm install

worked like a charm maybe it'll help someone else.

0
18

When seeing this kind of message on ionic or anywhere else, do run npm audit fix and see if you can successfully follow the given advice to resolve all "high severity vulnerability" issues and contribute the resulting updated dependencies back to the given codebase.

What's happening here is that a package called chokidar is being used to "watch" filesystem directories for "events" (like files being added). chokidar is a wrapper for Linux-, Windows-, and Mac-specific filesystem-watching packages, of which fsevents is the Mac variant. So, I am pretty sure anything that uses chokidar is going to have fsevents as an optional dependency, but as others have said, this WARN message can be safely ignored, as chokidar supports all common desktop architectures.

6

If like me, you got this issue because of using two different package managers at the same time (E.g. yarn and npm), you can simply remove the lockfile and rerun your package manager.

rm package-lock.json

The lockfile will be regenerated the next time you run your package manager. I got this error while trying to upgrade the packages with npm upgrade. After deleting the lockfile, upgrade proceeded smoothly and the lockfile was created correctly.

0
3

This warning will appear if you added IOS as platform to your project and run npm i on Windows or Linux. As you can't build IOS packages on these systems anyway you can safely ignore this warning.

2

After opening the command prompt or PowerShell in the administrator mode, what helped me was following this answer here.

I ran the command: npm i --force and that seemed to fix the issue.

0

If you're seeing this error in a node Github workflow, you can update the runs-on value in node.js.yml to macos-latest and it will work. Worked for me anyways.

0

The critical breakthrough for me was actually simple:

yarn remove fsevents

I verified that it worked by ctrl + f in yarn.lock for 'fsevents'. Before removing it, it appeared 9 times, after removing it, only 8. So I knew it had some effect.

Extra info

After removing fsevents:

git add .
git commit -m "Removed fsevents"
git push heroku master

and it worked.


Note that I also had to run bin/webpack-dev-server to see if the assets would precompile (better to try this locally where you can quickly address any deficiencies, rather than on heroku where it will take time to build).

I fixed any missing libraries with something like yarn add '@rails/activestorage' '@rails/ujs' etc, and when the app went to heroku it worked.

0

npm i work on dev machine, but fail on the CI pipeline.

The problem was the package-lock.json format version. On my dev machine, I have a most recent version of npm that on the CI machine. The recent npm version has generated a package-lock.json with lockfileVersion at 2 :

{
  "name": "MyAwesomeProject",
  "version": "1.0.0",
  "lockfileVersion": 2,
  "requires": true,
  "packages": {
    ...
  }
}

I removed package-lock.json from my repository and build CI worked.

0

I had to add webpack: ^5.87.0 to devDependencies in package.json. Then delete node_modules and package-lock.json, and in case npm cache clean --force and finally the npm install.

if you crawl up the package-lock.json, the module chain is as follows: fsevents => chokidar => watchpack => webpack. I did not need to add win32 to the arch targets

0

Try upgrading the node version to 8.5.0. Version >=8 suppresses this issue.

-10

You have to add win64 on package.json file

For example

{"os":"darwin,linux","arch":"any"} will replace with

{"os":"darwin,linux,win32,win64","arch":"any"}

1
  • 1
    My package.json don't have {"os":"darwin,linux","arch":"any"} but I still get the message npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    – Uri Gross
    Commented May 4, 2020 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.