9

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

2
  • Update Node to version 8.9 or higher. That is a newer requirement. Then try this all again. Commented May 31, 2018 at 10:09
  • yes it was indeed about the node version, i uninstalled node and installed v8.11.1, and it worked. thanks @R.Richards Commented May 31, 2018 at 10:19

4 Answers 4

10

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

Sign up to request clarification or add additional context in comments.

Comments

5

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!

1 Comment

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?
0

First of all, all the things you have posted are Warnings and not errors.

It means the npm has skipped the dependencies.

This would be solved if you update the npm version to the latest, use this command:

npm i -g npm@latest  

// use sudo if you get permission error.

and try to install again.

Hope this helps.

7 Comments

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
Whats your npm version now?
npm version now is 6.1.0
Try this npm i -f -g npm@latest
still same warnings and couldn't recognize ng
|
0
$ npm install -g @angular/cli
C:\Users\Asus\Desktop\ng -> C:\Users\Asus\Desktop\node_modules\@angular\cli\bin\ng
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]
added 295 packages from 179 contributors in 120.715s

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.