npm install having warn issues - node.js

Trying to install dependencies below
npm install axios moment react-file-base64 redux redux-thunk
Having these warn issues
npm WARN #apideck/better-ajv-errors#0.3.2 requires a peer of ajv#>=8 but none is installed. You must install peer dependencies yourself.
npm WARN fork-ts-checker-webpack-plugin#6.5.0 requires a peer of typescript#>= 2.7 but none is installed. You must install peer dependencies yourself.
npm WARN react-file-base64#1.0.3 requires a peer of react#^15.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils#3.21.0 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
How can I fix it?

Those are peer dependencies, not actual dependencies. Here is a good article explaining the difference. Peer dependencies are just to let users know what versions of various packages your installed package is compatible with. You don't need to fix these issues, as they are just letting you know which versions of various packages are compatible IF you want to use those packages sometime in the future.
In short, you can just start you project as-is, there is nothing that needs fixing.

Newer versions of npm do not install peer dependencies automatically.
To get rid of your warnings, you can install the packages that are being requested as needed.
npm install --save-dev "<dependency_pkg>"
The --save-dev means that it will be saved to devDependencies
You can find much more details in the various answers on this similar question: npm WARN ... requires a peer of ... but none is installed. You must install peer dependencies yourself

Related

Vulnerabilities appears npm install npm audit npm audit fix --force in windows 10 , npm 6.4.1 node v10.13.0

npm audit
=== npm audit security report ===
Manual Review
Some vulnerabilities require your attention to resolve
Visit https://go.npm.me/audit-guide for additional guidance
Moderate Prototype Pollution
Package hoek
Patched in > 4.2.0 < 5.0.0 || >= 5.0.3
Dependency of otp.js [dev]
Path otp.js > joi > hoek
More info https://nodesecurity.io/advisories/566
Low Denial of Service
Package mem
Patched in >=4.0.0
Dependency of react-native
Path react-native > #react-native-community/cli > metro >
metro-inspector-proxy > yargs > os-locale > mem
More info https://nodesecurity.io/advisories/1084
.......
npm audit fix --force
Error:
npm WARN using --force I sure hope you know what you are doing.
npm WARN commonmark-react-renderer#4.3.4 requires a peer of commonmark#^0.27.0 || ^0.26.0 || ^0.24.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb#17.1.1 requires a peer of eslint#^4.19.1 || ^5.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb-base#13.2.0 requires a peer of eslint#^4.19.1 || ^5.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react-native#3.7.0 requires a peer of eslint#^3.17.0 || ^4 || ^5 but none is installed. You must install peer dependencies yourself.
npm WARN jsdom#15.2.1 requires a peer of canvas#^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws#7.2.3 requires a peer of bufferutil#^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws#7.2.3 requires a peer of utf-8-validate#^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-fast-image#7.0.2 requires a peer of react-native#^0.60.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-keyboard-input#5.4.1 requires a peer of react-native#^0.57.3 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-responsive-ui#1.1.1 requires a peer of react#16.0.0-alpha.6 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-responsive-ui#1.1.1 requires a peer of react-native#^0.43.4 but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation-drawer#1.4.0 requires a peer of react-native-screens#^1.0.0 || ^1.0.0-alpha but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation-stack#1.10.3 requires a peer of react-native-screens#^1.0.0 || ^1.0.0-alpha but none is installed. You must install peer dependencies yourself
>
>
up to date in 20.457s
fixed 0 of 6 vulnerabilities in 1710074 scanned packages
6 vulnerabilities required manual review and could not be updated
anyone could help plz????
problem was with 'npm install' and 'npm yarn install'
This helped me
'choco install yarn'
'cd project_folder'
'yarn global add react-native-cli'
'yarn'

Installing React project as symlink shows vulnerability warnings

I'm trying to share React components between a web project and desktop project. I found this article that details how to do so while not ejecting from create-react-app.
https://medium.com/capriza-engineering/sharing-source-code-and-libraries-in-react-bd30926df312
In short, it says:
- Create two React projects with CRA, one with the shared components and another that will be consuming them.
- Install the shared project in the consumer project as a symlink with npm install "../shared-project".
- Use react-app-rewired and customize-cra to make Babel compile everything in the common folder.
Although, after using npm install "../shared-project" I get the following:
npm WARN deprecated left-pad#1.3.0: use String.prototype.padStart()
npm WARN deprecated flatten#1.0.2: I wrote this module a very long time ago; you should use something else.
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\jest.cmd as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\jest
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\jest as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\jest
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\rimraf.cmd as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\rimraf
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\rimraf as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\rimraf
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\svgo.cmd as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\svgo
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\svgo as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\svgo
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\js-yaml.cmd as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\js-yaml
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\js-yaml as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\js-yaml
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\browserslist.cmd as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\browserslist
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\browserslist as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\browserslist
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\semver.cmd as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\semver
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\semver as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\semver
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\esparse.cmd as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\esprima
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\esvalidate.cmd as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\esprima
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\esvalidate as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\esprima
npm WARN rm not removing D:\Projects--Tests\Project\web\node_modules\.bin\esparse as it wasn't installed by D:\Projects--Tests\Project\web\node_modules\esprima
> core-js#2.6.9 postinstall D:\Projects--Tests\Project\web\node_modules\babel-runtime\node_modules\core-js
> node scripts/postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> core-js#3.1.4 postinstall D:\Projects--Tests\Project\web\node_modules\core-js
> node scripts/postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN #typescript-eslint/eslint-plugin#1.13.0 requires a peer of eslint#^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #typescript-eslint/parser#1.13.0 requires a peer of eslint#^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ts-pnp#1.1.4 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN ts-pnp#1.1.2 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN tsutils#3.17.1 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN #typescript-eslint/parser#1.13.0 requires a peer of eslint#^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #typescript-eslint/eslint-plugin#1.13.0 requires a peer of eslint#^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ts-pnp#1.1.2 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN tsutils#3.17.1 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.0.7 (node_modules\react-scripts\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.0.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ shared#0.1.0
added 126 packages from 43 contributors, removed 190 packages, updated 1297 packages and audited 1794232 packages in 314.002s
found 14108 vulnerabilities (3 moderate, 14104 high, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details
If I continue with the steps detailed above everything works but what worries me the most is the 3 moderate, 14104 high, 1 critical message. I don't what to look past it. Any idea how can I fix this?
Thanks in advance!

NPM unmet peer dependency on every package i try to install

I am very new to the frustrating world of NPM.
I have run create-react-app, it installs except for the following warning messages
yarn add v1.17.3
[1/4] Resolving packages...
warning react-scripts > fsevents#2.0.6: Please update: there are crash fixes
[2/4] Fetching packages...
info fsevents#1.2.9: The platform "linux" is incompatible with this module.
info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.0.6: The platform "linux" is incompatible with this module.
info "fsevents#2.0.6" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "react-scripts > #typescript-eslint/eslint-plugin#1.6.0" has unmet peer dependency "typescript#*".
warning "react-scripts > #typescript-eslint/parser#1.6.0" has unmet peer dependency "typescript#*".
warning "react-scripts > #typescript-eslint/eslint-plugin > #typescript-eslint/typescript-estree#1.6.0" has unmet peer dependency "typescript#*".
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.10.0" has unmet peer dependency "typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 11 new dependencies.
Once it goes through to the end, if i try to install another package (any package) i.e npm install bootstrap --save i keep getting errors like;
npm WARN deprecated left-pad#1.3.0: use String.prototype.padStart()
npm WARN deprecated flatten#1.0.2: I wrote this module a very long time ago; you should use something else.
npm WARN deprecated fsevents#2.0.6: Please update: there are crash fixes
npm WARN rm not removing /home/vagrant/admin/node_modules/.bin/jest as it wasn't installed by /home/vagrant/admin/node_modules/jest
npm WARN rm not removing /home/vagrant/admin/node_modules/.bin/uglifyjs as it wasn't installed by /home/vagrant/admin/node_modules/uglify-js
npm WARN rm not removing /home/vagrant/admin/node_modules/.bin/semver as it wasn't installed by /home/vagrant/admin/node_modules/semver
npm WARN rm not removing /home/vagrant/admin/node_modules/.bin/esparse as it wasn't installed by /home/vagrant/admin/node_modules/esprima
npm WARN rm not removing /home/vagrant/admin/node_modules/.bin/esvalidate as it wasn't installed by /home/vagrant/admin/node_modules/esprima
npm WARN bootstrap#4.3.1 requires a peer of jquery#1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap#4.3.1 requires a peer of popper.js#^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN #typescript-eslint/parser#1.6.0 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN #typescript-eslint/eslint-plugin#1.6.0 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN ts-pnp#1.1.2 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN #typescript-eslint/typescript-estree#1.6.0 requires a peer of typescript#* but none is installed. You must install peer dependencies yourself.
npm WARN tsutils#3.15.0 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm ERR! path /home/vagrant/admin/node_modules/#hapi/topo/node_modules/#hapi/hoek/package.json.1181420959
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/admin/node_modules/#hapi/topo/node_modules/#hapi/hoek/package.json.1181420959'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-08-05T11_56_29_110Z-debug.log
I have tried updating the packages using `npm -g update. But still nothing
Any help would be greatly appreciated, its driving me NUTS!
There are a number of packages on npm that attempt to solve this very problem in different ways. I've used npx npm-install-peers in the past, but I had to run it again after every new install, as the peer dependencies were wiped out on every normal npm install.
Edit: you might want to add npm-install-peers to both postinstall and postuninstall scripts so you don't have to do it manually each time you (un)install something.
I just ran:
npm install typescript
to install the latest and now I don't see that peer package error. You could also install it global, I suppose:
npm install -g typescript
which would most certainly work just the same.

Requires peer of graphql, but it's installed

I'm currently trying to generate a prisma.graphql file from my .graphqlconfig.yml, but I can't install globally npm i -g graphql-binding or npm i -g prisma-binding as I'm getting the following errors:
npm WARN graphql-binding#2.2.6 requires a peer of graphql#^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-import#0.5.3 requires a peer of graphql#^0.11.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-tools#3.1.0 requires a peer of graphql#^0.13.0 but none is installed. You must installpeer dependencies yourself.
npm WARN apollo-link#1.2.3 requires a peer of graphql#^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 but noneis installed. You must install peer dependencies yourself.
So I obviously installed graphql at a ^0.13 version with:
npm i -g graphql#0.13
This runs successfully, but the graphql bindings keep failing to install.
The command I need to run is:
graphql codegen
But without installing the bindings I'm not able to run it.
Any suggestion on how to solve this is welcome :)
EDIT
Using npx I managed to run
npx graphql codegen

Installing ant design with npm

I'm trying to install ant design in my project.
npm install antd --save
Results in the following warnings:
npm WARN react-lazy-load#3.0.12 requires a peer of react#^0.14.0 || ^15.0.0-0 but none was installed.
npm WARN react-lazy-load#3.0.12 requires a peer of react-dom#^0.14.0 || ^15.0.0-0 but none was installed.
npm WARN react-slick#0.14.11 requires a peer of react#^0.14.0 || ^15.0.1 but none was installed.
npm WARN react-slick#0.14.11 requires a peer of react-dom#^0.14.0 || ^15.0.1 but none was installed.
npm WARN draft-js#0.10.1 requires a peer of react#^0.14.0 || ^15.0.0-rc but none was installed.
npm WARN draft-js#0.10.1 requires a peer of react-dom#^0.14.0 || ^15.0.0-rc but none was installed.
npm WARN rc-hammerjs#0.6.6 requires a peer of react#^0.14.3 || ^15.0.0 but none was installed.
Inside the dependencies i can see:
"#types/react": "15.0.24",
"#types/react-dom": "15.5.0",
Does this mean that ant design is incompatible with these versions of react? What am i doing wrong? Any suggestions?
You have an older version of react which doesn't support ant-design yet. Try installing the latest version of react.

Resources