After installation of npm (version 4.1.2 on Windows 10) I executed "npm install". But I get the following warning:
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.0.17: wanted {"os":"darwin","arch":"any"} (current:
{"os":"win32","arch":"x64"})
Any ideas why?
The problem that the fsevents is module for OS X environment only. Probably your package.json or npm-shrinkwrap.json was created/updated on OS X and you are running npm install on a different OS, where fsevents should be omitted.
Related
Many questions such as this one talk about this very annoying behavior on non-mac OS.
When I run npm install I want to remain aware of any warnings, but in Windows or Linux I would get this:
$ ./npm install
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (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":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.7 (node_modules/laravel-mix/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN bootstrap#4.5.0 requires a peer of jquery#1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
added 279 packages from 165 contributors, removed 4 packages, updated 2 packages and audited 1978 packages in 27.632s
Notice that most WARN are caused by fsevents which is not available outside of macOS.
Some suggest to hide every warnings with:
npm --logevel=error install
Others advise to use:
npm install --no-optional --no-shrinkwrap --no-package-lock
But all these methods does not seem right to me. I only want to execute npm install and have a configuration file that would hide all optional dependencies that are not available on my operating system.
How can I do that?
npm install --no-optional prevents this warning.
When I run npm install command, it shows following warning
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.12 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
audited 18093 packages in 9.83s
36 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Based on my understanding and searching.
If you work on Windows OS, don't need to pay attention.
Because that is only for Mac OS. also NPM will not help install it into windows OS.
NPM fsevent
This module for MAC OS.
The FSEvents API in MacOS allows applications to register for notifications of changes to a given directory tree
Run This Command npm install --legacy-peer-deps
Trying to get into react, using npm and such, and I often get these types of warnings:
> npm install axios redux react-redux redux-thunk react-router-dom validator redux-form
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.8 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.8 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.0.6 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.0.6: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ redux-thunk#2.3.0
+ validator#10.11.0
+ axios#0.18.0
+ react-router-dom#5.0.0
+ redux#4.0.1
+ react-redux#7.0.2
+ redux-form#8.2.0
added 30 packages from 100 contributors and audited 878734 packages in 23.247s
found 0 vulnerabilities
Apparently I can just ignore them, but I'm just curious if there's a way to not get these warnings? Configure npm somehow? Adding something to package.json? A flag somewhere?
You can silence the npm WARN upon installation by specifying what types of errors you want to see.
You can run npm --logevel=error install.
By using --loglevel=error you will only see npm ERROR and ignore any WARN
It's a warning, due to the operating system. fsevents run on mac os environment but in windows, it works as optional dependencies that are the reason behind your warning after all its not an error.
you can use https://github.com/paulmillr/chokidar instead of fsevents.
The problem relates to the "shrinkwrap" or package-lock.json which gets persisted after every package manager execution. Subsequent attempts keep failing as this file is referenced instead of package.json.
Adding these options to the npm install command should allow packages to install again.
--no-optional argument will prevent optional dependencies from being installed.
--no-shrinkwrap argument, which will ignore an available package lock or
shrinkwrap file and use the package.json instead
.
--no-package-lock argument will prevent npm from creating a package-lock.json file.
The complete command looks like this:
npm install --no-optional --no-shrinkwrap --no-package-lock
you can look into following answer npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.14
I have created a vue-cli project.
And I tried to add vuetify but I couldn't do it
I've run: npm install vuetify --save
A error came out on terminal:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.2.3 (node_modules/sane/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
When I try to import vuetify on main.js it says that can't find the module.
Does anyone know how to fix/install it?
You could try using yarn, I find it sometimes performs better
install yarn
npm i -g yarn
Then install dependencies (run in your package.json file folder)
yarn
You can also do a clean install by first removing the nodes_modules folder, and then install without optional dependencies npm install --no-optional
I'm trying to install react-native-cli by using the following command:
C:\WINDOWS\System32>npm install -g react-native -cli
and I'm getting the following errors, can someone help on this matter?
npm WARN deprecated gulp-util#3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
D:\Programming\React.js\ProgrammingReact.jsnode_modules\node_modules\react-native -> D:\Programming\React.js\ProgrammingReact.jsnode_modules\node_modules\node_modules\react-native\local-cli\wrong-react-native.js
npm WARN react-native#0.54.0 requires a peer of react#^16.3.0-alpha.1 but none is installed. You must install peer dependencies yourself.
npm WARN #babel/plugin-check-constants#7.0.0-beta.38 requires a peer of #babel/core#7.0.0-beta.38 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules\react-native\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"})