error while installing angular/cli using npm

28,520

Solution 1

Try using the below command from your project folder:

npm audit fix

If it still shows it has fixed only few of the vulnerabilities, then use the below command

npm audit fix --force

Screen shot of the command that I used in my machine

Solution 2

This warning told everything:

Unsupported platform for [email protected]: **wanted** {"os":"darwin","arch":"any"} (**current**: {"os":"win32","arch":"x64"})

Only unix-based systems use fsevents, and You are using Windows!

Share:
28,520
prady
Author by

prady

Front End Lead at Impetus using Angular 8, ReactJS and Javascript.

Updated on July 17, 2022

Comments

  • prady
    prady almost 2 years

    When I tried to install angular cli using this command

    npm install -g @angular/cli

    I got below mentioned error

    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 
    (node_modules\@angular\cli\node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY:  Unsupported platform for 
    [email protected]: wanted {"os":"darwin","arch":"any"} 
    (current: {"os":"win32","arch":"x64"}) 
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.1.2 (node_modules\@angular\cli\node_modules\watchpack\node_modules\chokidar\node_modules\fsevents): 
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.1.2 (node_modules\@angular\cli\node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents): 
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
    npm WARN [email protected] requires a peer of ajv@^6.0.0 but none was installed. 
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\@angular\cli\node_modules\node-sass): 
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] postinstall: `node scripts/build.js 
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
    

    any idea whats the issue?

    my node version is 6.9.2 and npm version is 3.10.9

  • prady
    prady almost 6 years
    after successfully updating npm, when i do try to install angular/cli again i get below mentioned warnings npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\@angular\cli\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) + @angular/[email protected] updated 1 package in 44.551s and ng -v returns unrecognizable command
  • Harshal Yeole
    Harshal Yeole almost 6 years
    Whats your npm version now?
  • prady
    prady almost 6 years
    npm version now is 6.1.0
  • Harshal Yeole
    Harshal Yeole almost 6 years
    Try this npm i -f -g npm@latest
  • prady
    prady almost 6 years
    still same warnings and couldn't recognize ng
  • prady
    prady almost 6 years
    while ng is not recognized as a command but this returns angular package version npm list -g @angular/cli C:\Users\AppData\Roaming\npm `-- @angular/[email protected] , whats missing here
  • Harshal Yeole
    Harshal Yeole almost 6 years
    try ng new demoProject
  • Bruno Bieri
    Bruno Bieri about 5 years
    I know that only unix-based systems are supported but I don't need the warning in all my builds. Do you know a way on windows to get rid of this warning?