UNMET PEER DEPENDENCY ISSUE - node.js

I have been trying to install the ngx bootstrap from [https://ng-bootstrap.github.io/#/getting-started]
by entering the command: npm install ngx-bootstrap --save
but the result is this:
+-- UNMET PEER DEPENDENCY #angular/common#2.4.10
+-- UNMET PEER DEPENDENCY #angular/compiler#2.4.10
+-- UNMET PEER DEPENDENCY #angular/core#2.4.10
+-- UNMET PEER DEPENDENCY #angular/forms#2.4.10
+-- UNMET PEER DEPENDENCY jquery#1.9.1 - 3
+-- ngx-bootstrap#2.0.0-beta.9
+-- UNMET PEER DEPENDENCY popper.js#^1.12.3
`-- UNMET PEER DEPENDENCY typescript#2.0.10
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.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN #ng-bootstrap/ng-bootstrap#1.0.0-beta.5 requires a peer of #angular/core#^4.0.3 but none was installed.
npm WARN #ng-bootstrap/ng-bootstrap#1.0.0-beta.5 requires a peer of #angular/common#^4.0.3 but none was installed.
npm WARN #ng-bootstrap/ng-bootstrap#1.0.0-beta.5 requires a peer of #angular/forms#^4.0.3 but none was installed.
npm WARN bootstrap#4.0.0-beta.2 requires a peer of jquery#1.9.1 - 3 but none was installed.
npm WARN bootstrap#4.0.0-beta.2 requires a peer of popper.js#^1.12.3 but none was installed.
npm WARN ngx-bootstrap#2.0.0-beta.9 requires a peer of #angular/common#>=4.3.0 || >5.0.0 but none was installed.
npm WARN ngx-bootstrap#2.0.0-beta.9 requires a peer of #angular/compiler#>=4.3.0 || >5.0.0 but none was installed.
npm WARN ngx-bootstrap#2.0.0-beta.9 requires a peer of #angular/core#>=4.3.0 || >5.0.0 but none was installed.
npm WARN ngx-bootstrap#2.0.0-beta.9 requires a peer of #angular/forms#>=4.3.0 || >5.0.0 but none was installed.
npm WARN ngx-bootstrap#2.0.0-beta.9 requires a peer of typescript#>=2.3.0 but none was installed.
I do not understand what's happening.
I am fairly new to Angular 2 and the relevant technologies. Would appreciate your help ! Thank you.

hello you need to install your perDependencies, if you install a package that depends on specific versions of other packages, If it didn't find the correct version of package then "Peer dependency" is unmet, try this:
npm install -g npm-install-peers
npm-install-peers
this will install peerDependencies

Related

"npm install #azure/msal-browser #azure/msal-angular#latest" but nothing inside of node_modules

I'm trying to include Azure AD for the login, but after running npm install #azure/msal-browser #azure/msal-angular aswell as npm install #azure/msal-browser #azure/msal-angular#latest no new entries in the node_modules folder can be seen. So when trying to import the modules
import { MsalModule } from '#azure/msal-angular';
import { PublicClientApplication } from '#azure/msal-browser';
I get the warning TS2307: Cannot find module '#azure/msal-browser' or its corresponding type declarations
When running the commands it seems to install everything (I run it where the frontend is located, also tried running it in the folder where both frontend and backend are stored):
npm WARN #angular/cdk#9.2.4 requires a peer of tslib#^1.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ant-design/icons-angular#9.0.1 requires a peer of #angular/common#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ant-design/icons-angular#9.0.1 requires a peer of #angular/core#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ant-design/icons-angular#9.0.1 requires a peer of #angular/platform-browser#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ant-design/icons-angular#9.0.1 requires a peer of tslib#^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN #rollup/plugin-commonjs#15.1.0 requires a peer of rollup#^2.22.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer#5.2.2 requires a peer of #angular/compiler#>=2.3.1 <10.0.0 || >9.0.0-beta <10.0.0 || >9.1.0-beta <10.0.0 || >9.2.0-beta <10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer#5.2.2 requires a peer of #angular/core#>=2.3.1 <10.0.0 || >9.0.0-beta <10.0.0 || >9.1.0-beta <10.0.0 || >9.2.0-beta <10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-zorro-antd#9.2.2 requires a peer of #angular/animations#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-zorro-antd#9.2.2 requires a peer of #angular/common#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-zorro-antd#9.2.2 requires a peer of #angular/forms#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-zorro-antd#9.2.2 requires a peer of #angular/core#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-zorro-antd#9.2.2 requires a peer of #angular/platform-browser#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ng-zorro-antd#9.2.2 requires a peer of #angular/router#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (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"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ #azure/msal-browser#2.20.0
+ #azure/msal-angular#2.0.6
updated 2 packages and audited 1717 packages in 11.119s
Pretty much the only way npm will install something in a directory other than ./node_modules is if global is set. Run npm config get global. If it prints true, then this is your problem.
Find out where global is set with npm config list. Find global = true in the output, then start looking in the lines above it for a line that looks like ; "user" config from /Users/trott/.npmrc. That line will tell you if the problem is in your user config, project config, or global config. You can try to use npm config delete global to remove the setting, but the global setting itself may be messing with that command. (I'm not actually sure of the cause. All I know is that I've experienced npm config delete global having no effect.) It might be best to run npm config edit to edit the config file to delete that line. (You can also use the path to open the file in the editor of your choice. Just be very careful not to make any changes other than removing the global setting line.)

How can someone deal with webpack versions issues « requires a peer of ... but none is installed »?

First I receive this error: optimize-css-assets-webpack-plugin#5.0.4 requires a peer of webpack#^4.0.0 then I try with this: npm i optimize-css-assets-webpack-plugin#latest but got that message: terser-webpack-plugin#5.0.3 requires a peer of webpack#^5.1.0
I am seeking for a specific answer to my problem but I think it would be useful also for everyone else to have a general way of thinking about how to deal with similar issues from any other NPM packages
I have this general issue as I am trying to use °NEST JS° & °REACT° & °MY TS WORKFLOW° in the same repo...
I don't know if I have to drill down each possible dependency tree or If I have to open multiple issues or if I have to take care of these problems myself (alone)...
Below trying to get ZERO warning messages installing 3 versions of webpack next#5.0.0-rc.6 lates#5.4.0 and 4#4.44.2
npm install webpack#next # + webpack#5.0.0-rc.6
npm WARN babel-loader#8.1.0 requires a peer of webpack#>=2 but none is installed. You must install peer dependencies yourself.
npm WARN css-loader#5.0.1 requires a peer of webpack#^4.27.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-webpack-plugin#2.2.0 requires a peer of webpack#^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN file-loader#6.2.0 requires a peer of webpack#^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN html-webpack-plugin#4.5.0 requires a peer of webpack#^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN mini-css-extract-plugin#1.3.0 requires a peer of webpack#^4.4.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optimize-css-assets-webpack-plugin#5.0.4 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN postcss-loader#4.0.4 requires a peer of webpack#^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader#10.0.5 requires a peer of webpack#^4.36.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN style-loader#2.0.0 requires a peer of webpack#^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN terser-webpack-plugin#5.0.3 requires a peer of webpack#^5.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN url-loader#4.1.1 requires a peer of webpack#^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware#3.7.2 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server#3.11.0 requires a peer of webpack#^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-manifest-plugin#2.2.0 requires a peer of webpack#2 || 3 || 4 but none is installed. You must install peer dependencies yourself.
npm WARN workbox-webpack-plugin#6.0.0-alpha.3 requires a peer of webpack#^4.4.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN terser-webpack-plugin#4.2.3 requires a peer of webpack#^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm install webpack#latest # + webpack#5.4.0
npm WARN optimize-css-assets-webpack-plugin#5.0.4 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware#3.7.2 requires a peer of webpack#^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-manifest-plugin#2.2.0 requires a peer of webpack#2 || 3 || 4 but none is installed. You must install peer dependencies yourself.
npm install webpack#4 # + webpack#4.44.2
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 WARN notsup Unsupported engine for watchpack-chokidar2#2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"15.1.0","npm":"6.14.8"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2#2.0.0
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 terser-webpack-plugin#5.0.3 requires a peer of webpack#^5.1.0 but none is installed. You must install peer dependencies yourself.
You appear to have an incompatible set of packages. I'm not sure about the syntax, my experience is with composer. If you look though that list you will see most of your packages require either a v4 OR v5:
npm WARN mini-css-extract-plugin#1.3.0 requires a peer of webpack#^4.4.0 || ^5.0.0 ...
You have one package that requires a v4 exclusively and another requires a v5 exclusively
npm WARN optimize-css-assets-webpack-plugin#5.0.4 requires a peer of webpack#^4.0.0 ...
npm WARN terser-webpack-plugin#5.0.3 requires a peer of webpack#^5.1.0 ...

npm audit: how to update high vulnerabilities for Jhipster

When I audit my vulnerabilities in jhipster 6.10.1 I find the following:
D:\JHipster\liquidbasetwo>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
Low Prototype Pollution
Package lodash
Patched in >=4.17.19
Dependency of generator-jhipster [dev]
Path generator-jhipster > jhipster-core > lodash
More info https://npmjs.com/advisories/1523
Low Prototype Pollution
Package lodash AND OTHER LIKE THIS ONE
High Remote Code Execution
Package serialize-javascript
Patched in >=3.1.0
Dependency of workbox-webpack-plugin [dev]
Path workbox-webpack-plugin > workbox-build >
rollup-plugin-terser > serialize-javascript
More info https://npmjs.com/advisories/1548
found 5 vulnerabilities (4 low, 1 high) in 2556 scanned packages
5 vulnerabilities require manual review. See the full report for details.
So I try to update: npm install serialize-javascript, which gives me lots of warnings and a high vulnerability that do not disappear:
D:\JHipster\liquidbasetwo>npm install serialize-javascript
npm WARN #angular/compiler#9.1.11 requires a peer of tslib#^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN #angular/compiler-cli#10.0.0 requires a peer of #angular/compiler#10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #angular/localize#10.0.0 requires a peer of #angular/compiler#10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #angular/platform-browser-dynamic#10.0.0 requires a peer of #angular/compiler#10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #fortawesome/angular-fontawesome#0.6.1 requires a peer of #angular/core#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #fortawesome/angular-fontawesome#0.6.1 requires a peer of tslib#^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ng-bootstrap/ng-bootstrap#6.1.0 requires a peer of #angular/common#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ng-bootstrap/ng-bootstrap#6.1.0 requires a peer of #angular/core#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ng-bootstrap/ng-bootstrap#6.1.0 requires a peer of #angular/forms#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ng-bootstrap/ng-bootstrap#6.1.0 requires a peer of #angular/localize#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ng-bootstrap/ng-bootstrap#6.1.0 requires a peer of tslib#^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ngx-translate/core#12.1.2 requires a peer of tslib#^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN #ngx-translate/http-loader#5.0.0 requires a peer of tslib#^1.10.0 but none is installed. You must install peer dependencies yourself.
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.
npm WARN bootstrap#4.5.0 requires a peer of popper.js#^1.16.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer#5.2.2 requires a peer of #angular/core#>=2.3.1 <10.0.0 || >9.0.0-beta <10.0.0 || >9.1.0-beta <10.0.0 || >9.2.0-beta <10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-cookie-service#3.0.4 requires a peer of #angular/common#^9.0.5 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-cookie-service#3.0.4 requires a peer of #angular/core#^9.0.5 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-cookie-service#3.0.4 requires a peer of tslib#^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-webstorage#5.0.0 requires a peer of #angular/common#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-webstorage#5.0.0 requires a peer of #angular/core#^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-webstorage#5.0.0 requires a peer of tslib#^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#2.1.3 (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"})
And then some others again in a circular reference. Is there a way to stop all this and fix all vulnerabilities at once?
Thanks

Can these npm warnings be reduced/solved somehow?

I'd like to reduce/solve the below warnings from the below npm command but I don't know how to proceed.
Some of the warning appear to be spurious. For example:
requires a peer of #babel/core#^7.0.0-0 but none is installed
But in fact, #babel/core#7.6.2 is shown to be installed. Is it not that 7.6.2 fits ^7.0.0-0?
Any ideas?
(Since posting this I've discovered that the warnings are related to having node_modules be a symlink. As recommended here (https://github.com/npm/npm/issues/9479#issuecomment-146519463) I've made the symlink target directory be named node_modules but the warnings persist. Still looking for ideas on how to proceed. I really need to use a symlink.)
+ npm i babel-loader #babel/core #babel/preset-env #babel/preset-react webpack css-loader html-webpack-plugin style-loader webpack-cli webpack-dev-server async-script-loader base-64 create-react-class react react-dom react-router-dom sweetalert whatwg-fetch react-google-login
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN #babel/plugin-syntax-async-generators#7.2.0 requires a peer of #babel/core#^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN #babel/plugin-syntax-dynamic-import#7.2.0 requires a peer of #babel/core#^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN #babel/plugin-syntax-json-strings#7.2.0 requires a peer of #babel/core#^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN #babel/plugin-syntax-object-rest-spread#7.2.0 requires a peer of #babel/core#^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN #babel/plugin-syntax-optional-catch-binding#7.2.0 requires a peer of #babel/core#^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN #babel/plugin-syntax-jsx#7.2.0 requires a peer of #babel/core#^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN #babel/plugin-syntax-jsx#7.2.0 requires a peer of #babel/core#^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN #babel/plugin-syntax-jsx#7.2.0 requires a peer of #babel/core#^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN mini-create-react-context#0.3.2 requires a peer of react#^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ babel-loader#8.0.6
+ #babel/core#7.6.2
+ #babel/preset-react#7.0.0
+ #babel/preset-env#7.6.2
+ css-loader#3.2.0
+ style-loader#1.0.0
+ async-script-loader#0.0.1
+ base-64#0.1.0
+ html-webpack-plugin#3.2.0
+ create-react-class#15.6.3
+ react#16.10.1
+ react-dom#16.10.1
+ react-router-dom#5.1.1
+ sweetalert#2.1.2
+ whatwg-fetch#3.0.0
+ react-google-login#5.0.5
+ webpack-cli#3.3.9
+ webpack#4.41.0
+ webpack-dev-server#3.8.1

Not able to install angularfire2 via npm

I am trying to install angularfire2 from npm by running, but I keep getting this error
D:\angular\firebase\apartment>npm install angularfire2 firebase --save
apartment#0.0.0 D:\angular\firebase\apartment
+-- angularfire2#4.0.0-rc.1
`-- firebase#4.1.3
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 angularfire2#4.0.0-rc.1 requires a peer of #angular/common#^4.0.0 but none was installed.
npm WARN angularfire2#4.0.0-rc.1 requires a peer of #angular/compiler#^4.0.0 but none was installed.
npm WARN angularfire2#4.0.0-rc.1 requires a peer of #angular/core#^4.0.0 but none was installed.
npm WARN angularfire2#4.0.0-rc.1 requires a peer of #angular/platform-browser#^4.0.0 but none was installed.
npm WARN angularfire2#4.0.0-rc.1 requires a peer of #angular/platform-browser-dynamic#^4.0.0 but none was installed.
Last 5 of npm warn's are due to dependencies. You don't have the required modules to install angularfire.
Two possible solutions are, either downgrade your npm i.e. lower than 3.
npm < 3 can download the depending modules by itself or install the 5 depending modules first.

Resources