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
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.
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.
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.
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
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With