How to solve npm install throwing fsevents warning on non-MAC OS?

前端 未结 15 1793
眼角桃花
眼角桃花 2020-11-28 04:07

Following warning is being thrown on npm install command -

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\\rea
ct-         


        
相关标签:
15条回答
  • 2020-11-28 04:39
    npm i -f
    

    I'd like to repost some comments from this thread, where you can read up on the issue and the issue was solved.

    This is exactly Angular's issue. Current package.json requires fsevent as not optionalDependencies but devDependencies. This may be a problem for non-OSX users.

    Sometimes

    Even if you remove it from package.json npm i still fails because another module has it as a peer dep.

    So

    if npm-shrinkwrap.json is still there, please remove it or try npm i -f

    0 讨论(0)
  • 2020-11-28 04:44

    If you want to hide this warn, you just need to install fsevents as a optional dependency. Just execute:

    npm i fsevents@latest -f --save-optional
    

    ..And the warn will no longer be a bother.

    0 讨论(0)
  • 2020-11-28 04:44

    I had got this error, Linux system(Ubuntu) and This might happen when you run :

    npm install

    1) If the project is not present in your localdisk/computer, copy it to your computer and try again. So you get the permission to access folder (Just make sure you have access permission).

    2) If you still get some warnings or errors, run:

    npm audit fix

    This will solve vulnerabilities in your dependencies and can help you fix a vulnerability by providing simple-to-run npm commands and recommendations for further troubleshooting.

    Hope it helps!

    0 讨论(0)
  • 2020-11-28 04:46

    I also had the same issue though am using MacOS. The issue is kind of bug. I solved this issue by repeatedly running the commands,

    sudo npm cache clean --force 
    sudo npm uninstall 
    sudo npm install
    

    One time it did not work but when I repeatedly cleaned the cache and after uninstalling npm, reinstalling npm, the error went off. I am using Angular 8 and this issue is common

    0 讨论(0)
  • 2020-11-28 04:48

    I'm using, Angular CLI: 8.1.2 Node: 12.14.1 OS: win32 x64

    Strangely, this helped me

    npm cache clean --force
    npm uninstall @angular/cli
    npm install @angular/cli@8.1.2
    
    0 讨论(0)
  • 2020-11-28 04:48

    Yes, it works when with the command npm install --no-optional
    Using environment:

    • iTerm2
    • macos login to my vm ubuntu16 LTS.
    0 讨论(0)
提交回复
热议问题