npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 - node.js

I'm trying to install Angular using the Angular CLI but I'm getting an error when I try to run this command.
Command
npm install -g #angular/cli
Error:
C:\Users\abc>npm install -g #angular/cli
C:\Users\abc\AppData\Roaming\npm\ng -> C:\Users\abc\AppData\Roaming\npm\node_modules\#angular\cli\bin\ng
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules\#angular\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ #angular/cli#7.3.6
updated 1 package in 102.686s
Node Version v10.15.3

This is a warning not an error, and it's because you're on Windows. FSevents only works on Mac so it's not needed on Windows and that's why it's SKIPPING OPTIONAL DEPENDENCY.
And no as of right now there is no way to get rid of that being printed into the console so just ignore it given the fact that it's not doing anything anyways rather it's just being a bit verbose and telling you that it's not being used.

This is because you're running on windows. A lot of apps use that library, but it only works on the Mac, so they use something else for Windows and Linux. That's why it's listed as "optional". You can ignore the warning.

Related

correctly downloaded node.js but still unable to install browser-sync and getting these warnings

The warning message is as follows :
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules\browser-sync\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ browser-sync#2.26.10
updated 1 package in 17.438s
This is simply a message telling you that fsevents wasn't installed because it's an optional package, but browser-events was installed.
The first line is:
SKIPPING OPTIONAL DEPENDENCY: fsevents
This means that for some reason or another, fsevents wasn't installed.
If you then go to the second line, it tells you why:
Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
If we look on the NPM page of fsevents:
Native access to MacOS FSEvents in Node.js
We can see that fsevents is a package ment to be used for MacOS. OS darwin is the equivalent to MacOS. Since you have Windows installed, node didn't install fsevents
The next line:
+ browser-sync#2.26.10
This shows that it added (+) browser-sync version 2.26.10 #2.26.10.
Then the last line is a summary that simply shows what node did.

issue on setting angular 4 on windows machine facing this error

I am getting an error to install angular4 cli with node & npm on the windows machine. getting this error
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules#angular\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
This is not an error, this is a warning.
It says that the dependency fsevents wants a darwin operating system, but you are running on a Windows (win32 OS) machine.
It is only a warning because it is just an optional dependency for mac users.
The warning may disapear if you update NPM, though.
More details in this github issue.

npm install -g #angular/cli command does not install angular cli

I am creating a sample angular2 web app. For that i have installed node.js (v 7.1.0)and NPM (v 3.10.9).
and now after opening system command prompt when I execute the command :
NPM install -g #angular/cli
to install angular cli I am getting the following shown results.
After doing ng -v to check the version of cli installed I am not getting the version number.
Is the cli not installed correctly?
or do I need to set any path variable in environment var?
What has to be done here? Please advise.
C:\Users\27727>d:
D:\>cd learn-angular
D:\learn-angular>npm i -g #angular/cli
npm WARN gentlyRm not removing C:\Users\27727\AppData\Roaming\npm\ng.cmd as it w
asn't installed by C:\Users\27727\AppData\Roaming\npm\node_modules\#angular\cli
npm WARN gentlyRm not removing C:\Users\27727\AppData\Roaming\npm\ng as it wasn'
t installed by C:\Users\27727\AppData\Roaming\npm\node_modules\#angular\cli
C:\Users\27727\AppData\Roaming\npm\ng -> C:\Users\27727\AppData\Roaming\npm\node
_modules\#angular\cli\bin\ng
C:\Users\27727\AppData\Roaming\npm
`-- #angular/cli#1.7.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\#a
ngular\cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#
1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\#a
ngular\cli\node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fs
events):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#
1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm WARN ajv-keywords#3.1.0 requires a peer of ajv#^6.0.0 but none was installed
.
D:\learn-angular>ng -v
'ng' is not recognized as an internal or external command,
operable program or batch file.
D:\learn-angular>
In your system please check this path ( C:\Program Files\nodejs ) is there in environment variables.

How to install Webpack into existing Angular application?

I tried to install Webpack into an existing directory of a project using this command:
npm install --save-dev webpack
However, it returns the following errors:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN extract-text-webpack-plugin#2.1.2 requires a peer of webpack#^2.2.0 but none was installed.
npm WARN webpack-dev-server#2.4.5 requires a peer of webpack#^2.2.0 but none was installed.
How do I fix this and install Webpack?
It seems that you are running this on Win32 according to
wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
Try to update your node/npm version.
Check out a version manager for node. For windows you can try this one.
Edit:
Author did not respond.
Things tried that might have worked:
npm install -f
npm install webpack#2.2.0

Force npm install to install optional dependencies for other platforms

I'm building a build task for Visual Studio Team Services. In this task I'm using 7zip-bin to package the binary for 7zip for linux, mac and windows.
This is all nice and it would work if I had the ability to deploy just the package.json to the build server, but no... A build task contains all its dependencies at build time.
Is there a way I can force npm to download all OS optional packages somehow? Or will I have to download the file myself during build and extract it?
Right now I'm using
npm install 7zip-bin --save
Which results in:
C:\temp>npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-linux#^1.0.3 (node_modules\7zip-bin\node_modules\7zip-bin-linux):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-linux#1.0.3: wanted {"os":"linux","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 7zip-bin-mac#^1.0.1 (node_modules\7zip-bin\node_modules\7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 7zip-bin-mac#1.0.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
installing each optional package directly isn't possible, when I run
npm install 7zip-bin-linux --save
on a windows machine, the install is skipped and I get a EBADPLATFORM error.
I understand I can't run these on my machine, but I need to package them in a vsix file (a glorified zip) so I can use them when my build task is running on these other platforms.
You should depend on these 3 optional packages, because you never know if 7zip-bin will change it's optional dependencies, which you are using directly.
For example:
dependencies: {
"7zip-bin-mac": "^1.0.1",
"7zip-bin-win": "^2.0.2",
"7zip-bin-linux": "^1.0.3"
}
Using either way, you need to run npm install -f to force the installation.

Resources