ERESOLVE unable to resolve dependency tree while installing ngx-toastr on angular 13 - angular13

Getting below error while trying to install ngx-toastr on my angular 13
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: p4-padmin#0.0.0
npm ERR! Found: #angular/common#13.0.3
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"~13.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#">=14.0.0-0" from ngx-toastr#15.0.0
npm ERR! node_modules/ngx-toastr
npm ERR! ngx-toastr#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\xyz\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xyz\AppData\Local\npm-cache\_logs\2022-06-27T09_19_20_284Z-debug.log

This worked for me:
Delete node_modules, package-lock.json
Update npm -> sudo npm install -g npm (on mac)
Run -> npm install in angular project folder
Run npm install ngx-toastr --force
Update angular.json file ("styles" array)
"./node_modules/font-awesome/css/font-awesome.css"
"./node_modules/ngx-toastr/toastr.css""
if you get error about "font-awesome"
Run -> npm install --save font-awesome --force
Second way (this also worked):
Update npm
Update Angular application following instructions from:
https://update.angular.io/
Run: npm install ngx-toastr
Run: npm install --save font-awesome
Update angular.json file ("styles" array)
"./node_modules/font-awesome/css/font-awesome.css"
"./node_modules/ngx-toastr/toastr.css""
Hope this will help.

Related

Couldn't install Axios in React Native via npm install axios

I have done in React Js multiple times but it is my first time using axios in React Native. When I install axios through npm install axios it gives a huge log error related to other libraries .
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-native-location-view#0.3.0
npm ERR! Found: react-native-vector-icons#8.1.0
npm ERR! node_modules/react-native-vector-icons
npm ERR! peer react-native-vector-icons#">7.0.0" from react-native-elements#3.4.2
npm ERR! node_modules/react-native-elements
npm ERR! react-native-elements#"^3.4.2" from the root project
npm ERR! peer react-native-vector-icons#"*" from react-native-paper#4.9.2
npm ERR! node_modules/react-native-paper
npm ERR! react-native-paper#"^4.9.2" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-vector-icons#"^4.4.3" from react-native-location-view#0.3.0
npm ERR! node_modules/react-native-location-view
npm ERR! react-native-location-view#"^0.3.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native-vector-icons#4.6.0
npm ERR! node_modules/react-native-vector-icons
npm ERR! peer react-native-vector-icons#"^4.4.3" from react-native-location-view#0.3.0
npm ERR! node_modules/react-native-location-view
npm ERR! react-native-location-view#"^0.3.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Suyash\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Suyash\AppData\Local\npm-cache\_logs\2021-12-07T15_22_51_263Z-debug.log
It should have been same as React JS but for some reason these errors are appearing.
This isn't an issue with Axios your dependencies are conflicting because they're out-dated. For example:
Could not resolve dependency:
npm ERR! peer react-native-vector-icons#"^4.4.3" from react-native-location-view#0.3.0
which is trying to pull version 4 and React Native Vector Icons is on version 9. You should update your dependencies and check for any conflicting code accordingly. Would also suggest using Yarn with React Native.
You can run in the terminal:
rm node_modules && rm package-lock.json && yarn install
if you have Yarn installed. If as you stated everything works correctly you could try:
npm i react-native-location-view --legacy-peer-deps
or:
npm i --legacy-peer-deps

Facing Issue while installing dependency issue in React project

I'm getting the following error when I attempt to install a new dependency in my React project:
C:\Users\abhinavverma Desktop Sodexo-Fe Matchiq-fe> npm i #cypress/instrument-cra
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree,
npm ERR! npm ERR! While resolving: match-iq#0.1.0
npm ERR! Found: prettier#1. 19.1
npm ERR! node_modules/prettier
npm ERR! dev prettier#"^1.19.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer prettier#">=2.0.0" from pretty-quick#3.1.1 I
npm ERR! node_modules/pretty-quick
npm ERR! dev pretty-quick#"^3.0.0" from the root project
npm ERR! npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\abhinavverma AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\abhinavverma\AppData\Local\npm-cache_logs 2021-08-12T18_35_58_522Z-debug.log
run the command again with --force on the end. It can't find the correct version of the dependency. It looks like the version is wrong.

After installing chai, i was installing chai-webdriverio as a dev dependency but i got this error

npm i chai-webdriverio --save-dev
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: webdriverio#1.0.0
npm ERR! Found: chai#4.3.4
npm ERR! node_modules/chai
npm ERR! dev chai#"^4.3.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer chai#"~4.0.1" from chai-webdriverio#1.0.0
npm ERR! node_modules/chai-webdriverio
npm ERR! dev chai-webdriverio#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
I was able to solve this issue by running
npm install chai-webdriverio --force
Note: Using --force makes the recommended protections to be disabled.
Another option is to install the required version of chai instead :
npm install chai#4.0.1 --save-dev
Maybe this is more consistent

Issues Installing Vue-Native with library vue-native-scripts

I am trying to create a project with Vue-Native following the instructions in the documentation:
https://vue-native.io/docs/installation.html
I am trying it with Expo and Vue-React, and in both cases I have the same error when I run "npm start":
Failed to construct transformer: Error: Cannot find module 'vue-native-scripts'
I try to install it with npm install vue-native-scripts --save-dev and I have the error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: vuenativetest#0.0.1
npm ERR! Found: react#16.13.1
npm ERR! node_modules/react
npm ERR! react#"16.13.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.1" from react-native#0.64.0
npm ERR! node_modules/react-native
npm ERR! react-native#"^0.64.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/miguel/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/miguel/.npm/_logs/2021-04-04T10_52_07_169Z-debug.log
I updated all libraries: React, React-Native, npm, Node, etc.
But I have the same error.
I am currently working on a vue-native project and encountered this problem when I started.
This seems to be a problem about the dependencies of a vue-native project having sub dependencies of different versions from other dependencies. When NPM sees this it just freaks out.
My solution is to start using yarn! Install it by the following:
$ npm i -g yarn
After its installed, its advised that you delete the project and redo the vue-native-cli init command so it can use yarn from there, but you can also just directly use the following command without deleting the project:
$ yarn install vue-native-scripts

Cannot run gatsby develop - There was a problem loading the local develop command

I am trying to run gatsby develop in order to start the development server but I am getting the following error:
There was a problem loading the local develop command. Gatsby may not be installed in your site's "node_modules" directory. Perhaps you need to run "npm install"? You might need to delete your "package-lock.json" as well.
This is the project that I am working on: https://github.com/andreiprv/andyprv-blog
Cloned from this repo: https://github.com/alxshelepenok/gatsby-starter-lumen
It is probably a dependency issue, but I don't have the know-how to figure out how to solve it. After I started the project with gatsby new etc, I've got the following errors:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-lumen#3.0.7
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.4.2" from gatsby#2.28.0
npm ERR! node_modules/gatsby
npm ERR! gatsby#"^2.27.4" from the root project
npm ERR! peer gatsby#"*" from #sentry/gatsby#5.28.0
npm ERR! node_modules/#sentry/gatsby
npm ERR! #sentry/gatsby#"^5.27.6" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/andreismbp/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/andreismbp/.npm/_logs/2020-12-04T17_22_00_512Z-debug.log
error Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
- error.js:56 makeError
[lib]/[gatsby-cli]/[execa]/lib/error.js:56:11
- index.js:114 handlePromise
[lib]/[gatsby-cli]/[execa]/index.js:114:26
- task_queues:93 processTicksAndRejections
node:internal/process/task_queues:93:5
- init-starter.js:135 install
[lib]/[gatsby-cli]/lib/init-starter.js:135:7
- init-starter.js:202 clone
[lib]/[gatsby-cli]/lib/init-starter.js:202:3
- init-starter.js:343 initStarter
[lib]/[gatsby-cli]/lib/init-starter.js:343:5
- create-cli.js:449
[lib]/[gatsby-cli]/lib/create-cli.js:449:9
I tried to uninstall and install gatsby again using npm uninstall --save gatsby && npm install --save gatsby
but it failed with the following errors
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-lumen#3.0.7
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.4.2" from gatsby#2.28.0
npm ERR! node_modules/gatsby
npm ERR! peer gatsby#"*" from #sentry/gatsby#5.28.0
npm ERR! node_modules/#sentry/gatsby
npm ERR! #sentry/gatsby#"^5.27.6" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/andreismbp/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/andreismbp/.npm/_logs/2020-12-04T17_51_08_843Z-debug.log
Thank you in advance!
Did the following, ran npm install --legacy-peer-deps
Then hit another error when running gatsby develop :
Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (88)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
error undefined failed
Fixed the above by downgrading node to v14.15.1. After that I needed to run npm rebuild node-sass
I've resolved this issue by running yarn install instead of npm install
Not sure if this may be related, I had a similar issue, but mine was caused by a mismatch dependency between my node version and the version some library was using, so after changing to another version it worked for me.
I noticed that there was an error by running npm install --loglevel verbose
see if you can get additional information.

Resources