Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while installing angular/cli using npm

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

like image 939
prady Avatar asked May 31 '18 09:05

prady


People also ask

Will npm install install Angular cli?

When you running npm install the Angular CLI gets installed locally for your project. Then, when you run npm start or npm run ng <your command> it will kick off. Then when you run ng <command> in your project directory, for commands like scaffolding - ng g <params> or ng update the global CLI will be in use.

Why does npm show error?

If you run npm and you receive a no compatible version found error, it means you have an outdated npm. This error is a consequence of joyent/node#8141, and is specific to the node installer for Windows.

How do you fix error this command is not available when running the Angular cli outside a workspace?

To Fix Error “This command is not available when running the Angular CLI outside a workspace Error”, Do Right-Click on yours project name in VS Code and Click “Open in Integrated Terminal” Option. It would open the project to your terminal and error would be fixed.


2 Answers

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

like image 148
Seetharaman Mohan Avatar answered Sep 27 '22 15:09

Seetharaman Mohan


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!

like image 34
Mirko Jelic Avatar answered Sep 27 '22 17:09

Mirko Jelic