npm WARN install Couldn't install optional dependency: Unsupported - node.js

I received this warning message:
npm WARN install Couldn't install optional dependency: Unsupported
when I ran the command:
$ npm i adaro --save
What does this warning mean? What is an optional dependency? Is it serious? How do I get rid of that warning?

The warning message is just a warning message and not an error. It does not affect the application.
It is a log message that an optional dependency could not be installed because it is not supported/needed on your current platform/cpu-arch. For example the package fsevents is often used as optional dependency but fails on any system that is not a Mac.
To show what package is throwing this message, run
$ npm install --verbose
This warning could also be triggered by packages having an engine set to something lower than what you are running. You can try
$ pm_config_engine_strict=false npm install
to get around this

Related

How to clear EPERM : operation not permitted warning while installing gulp

I'm trying to install gulp in Windows8 by issuing the below command,
C:\Users\acer>npm install gulp -g
C:\Users\acer\AppData\Roaming\npm\gulp-> C:\Users\acer\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules\gulp\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"})
+ gulp#4.0.0
updated 1 package in 63.384s
Although the installation was successful, while executing the gulp I'm receiving the below error.
C:\Users\acer>gulp -v
'gulp' is not recognized as an internal or external command,
operable program or batch file.
Can someone help to overcome this issue?.
You need to add the npm global directory to your PATH variable. You can do this by executing the below command.
set PATH=%PATH%;C:\Users\YOUR_USER_NAME_OR_LOGIN\AppData\Roaming\npm;
After issuing the above command, try executing gulp -v and it will work.
Hope this helps!

algular-cli installation issue with rxjs

I'm tryin' to install angular-cli into my linux Mint 32bit computer. But There's a failure to install it.
My command into terminal is:
npm install -g angular-cli
And the output:
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/home/shwokat/!/.npm-global-me/bin/ng -> /home/shwokat/!/.npm-global-me/lib/node_modules/angular-cli/bin/ng
/home/shwokat/!/.npm-global-me/lib
└─┬ angular-cli#1.0.0-beta.28.3
└── UNMET PEER DEPENDENCY rxjs#^5.0.1
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 fsevents#1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"ia32"})
npm WARN #angular/core#2.4.7 requires a peer of rxjs#^5.0.1 but none was installed.
Please write how to overcome this error & install angular-cli correctly ...
This is an issue with beta 30 of the CLI... the temporary fix is to install rxjs globally to resolve the dependency.
npm install rxjs -g
This has been addressed in the repo and will no longer be an issue with the next release.
UPDATE:
From #frankie4fingers in the comments, you may find success using the specific version:
npm install -g rxjs#5.0.1
I had the same issue, I was trying to install AngularJS 2 CLI using
npm install -g angular-cli
And I got the following warning and dependency error:
npm WARN deprecated angular-cli#1.0.0-beta.28.3: angular-cli has been renamed to #angular/cli. Please update your dependencies.
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/angular-cli
/usr/local/lib
└─┬ angular-cli#1.0.0-beta.28.3
└── UNMET PEER DEPENDENCY rxjs#^5.0.1
So I tried to installing using #angular/cli instead of angular-cli and it worked.
npm install -g #angular/cli
I'm in exactly the same boat. I had a simple angular-cli repo from a couple of months ago, cloned it to a new machine running OSX Sierra, started getting these peer dependency errors when running npm install.
I've tried a fresh project and I can't even install angular-cli. Have tried installing rxjs globally, and by specific version.
While this posts adds little it is intended as corroborating evidence of the issue, and indication that the issue is likely non OS-specific.
[update] Frustratingly, running npm ls -g shows rxjs#5.0.1 is present.

NPM Installation failed

I have downloaded latest version of nodejs for windows.
When I run command npm install it install some package and at last it gives me error
npm WARN optional Skipping failed optional dependency
/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or
architecture:fsevents#1.0.14
npm WARN vue-jwt-auth-example#1.0.0 No repository field.
I am trying to run Vue.js JWT Authentication
Please help, to fix this.
These are warnings, not errors, so everything still should run fine.
fsevents is an optional dependency, and because it is not supported by your operating system, it is skipped.
The other warning is related to you not having a repository field in your package.json file, so just something to tell you to fix, but not mandatory.
Everything should work fine!

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents

I'm trying to run this project.
After updating minimatch version to 3.10.9, I'm getting the following error:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\webpack\node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
My configuration:
Node v - 4.4.2
npm v - 3.10.9
32 bit windows OS
It's a warning, not an error. It occurs because fsevents is an optional dependency, used only when project is run on macOS environment (the package provides 'Native Access to Mac OS-X FSEvents').
And since you're running your project on Windows, fsevents is skipped as irrelevant.
There is a PR to fix this behaviour here: https://github.com/npm/cli/pull/169
This still appears to be an issue, causing package installations to be aborted with warnings about optional packages not being installed because of "Unsupported platform".
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
nJoy!
Using parameter --force:
npm i -f
This answer worked for me, add this to your package.json
"optionalDependencies": {
"fsevents": "^2.3.2"
}
Unsupported platform for fsevents
The current best solution is upgrading your version of npm, which won't have this warning.
If using a Windows machine, an easy way to upgrade is with the tool Upgrade npm on Windows.

Requiring unknown module ./bindings on react native

I'm trying to run my react-native project on android but when I try to execute it I get the following error on the android simulator:
"Requiering unknown module ./bindings. If you are sure the module is
there, try restarting the packager or running npm install"
The thing is that I have checked up node_modules and I can see that the module is there. I have already tried to remove node_modules and install all of them again but didn't work.
I have also tried to install bindings with npm install bindings and I get the following error:
npm WARN optional Skipping failed optional dependency
/noble/bluetooth-hci-socket:
npm WARN notsup Not compatible with your operating system or
architecture: bluetooth-hci-socket#0.4.4
I'm on MACOS

Resources