npm install fails - version mismatch - node.js

i am new to npm, and have trouble running npm install on this repo: https://github.com/ttencate/jfxr
after the initial install failed with error code 1, i found resources pointing towards updating the package versions.
after running
npx npm-check-updates -u
npm install still fails, this time with a reasonable error stack:
p#MBP-von-up app % npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: jfxr-app#0.14.0
npm ERR! Found: eslint#8.19.0
npm ERR! node_modules/eslint
npm ERR! dev eslint#"^8.19.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint#">=1.6.0 <7.0.0" from eslint-loader#2.2.1
npm ERR! node_modules/eslint-loader
npm ERR! dev eslint-loader#"^2.1.1" 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/tp/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tp/.npm/_logs/2022-07-05T13_34_08_046Z-debug-0.log
but i am still unclear on how to resolve this version mismatch.
also, running with the old version would be fine for me too, if it worked at all...
any help / tips towards resources appreciated!

Related

Resolving dependency conflict for npm install in Angular application

I had several error messages for overriding peer dependencies when doing an npm install. After following the steps proposed by the accepted solution to this post. The most essential part being change the ~ versions to ^, remove node_modules and (if it exists) package-lock.json and run npm install again. I have now reduced the error message to the following :
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: console#0.0.0
npm ERR! Found: tslib#2.4.0
npm ERR! node_modules/tslib
npm ERR! tslib#"^2.0.3" from the root project
npm ERR! tslib#"^2.0.0" from #angular/cdk#10.2.7
npm ERR! node_modules/#angular/cdk
npm ERR! #angular/cdk#"^10.2.0" from the root project
npm ERR! peer #angular/cdk#">=9.0.0" from mat-table-exporter#9.1.2
npm ERR! node_modules/mat-table-exporter
npm ERR! mat-table-exporter#"^9.0.2" from the root project
npm ERR! 1 more (#angular/material)
npm ERR! 6 more (#angular/common, #angular/core, #angular/material, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer tslib#"^1.10.0" from mat-table-exporter#9.1.2
npm ERR! node_modules/mat-table-exporter
npm ERR! mat-table-exporter#"^9.0.2" 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 /my/path/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /my/path/.npm/_logs/2022-07-21T15_27_07_820Z-debug-0.log
How do I solve this dependency issue? I cannot simply use --force or --legacy-peer-deps because my next step afterwards is moving from Angular 10 to 13. I tried doing the upgrade without fixing this issue and it forces #angular/cdk to remain at 10.x.x

While Migrating MaterialUI from V4 to V5: Dependency issue: not able to resolve

I'm rather new to upgrading dependencies on my local machine. I'm trying to upgrade MaterialUI using NPM from V4 to V5.
The moment I enter the code: npm install #mui/material #mui/styles, it gives me this huge error.
If someone could please guide me through this, that will be great.
PS C:\Users\rprua564\Documents\autobots-dashboard-appstatic> npm install #mui/material #mui/styles
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: autobots-next-appstatic#0.1.0
npm ERR! Found: react#18.1.0
npm ERR! node_modules/react
npm ERR! react#"^18.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^17.0.0" from #mui/styles#5.8.0
npm ERR! node_modules/#mui/styles
npm ERR! #mui/styles#"^5.8.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\rprua564\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\rprua564\AppData\Local\npm-cache\_logs\2022-05-22T20_15_01_551Z-debug.log

Errors in dependency tree every time I install a fresh react-app

It is been a while that I am getting an error every time I create a react app.
I tried to remove all node/npm versions and I reinstall a clean one with the latest node LTS, however, I am still getting the below error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: type-fest#0.21.3
npm ERR! node_modules/type-fest
npm ERR! type-fest#"^0.21.3" from ansi-escapes#4.3.2
npm ERR! node_modules/ansi-escapes
npm ERR! ansi-escapes#"^4.2.1" from #jest/core#26.6.3
npm ERR! node_modules/#jest/core
npm ERR! #jest/core#"^26.6.0" from jest#26.6.0
npm ERR! node_modules/jest
npm ERR! peer jest#"^26.0.0" from jest-watch-typeahead#0.6.1
npm ERR! node_modules/jest-watch-typeahead
npm ERR! 1 more (react-scripts)
npm ERR! 1 more (jest-cli)
npm ERR! ansi-escapes#"^4.3.1" from jest-watch-typeahead#0.6.1
npm ERR! node_modules/jest-watch-typeahead
npm ERR! jest-watch-typeahead#"0.6.1" from react-scripts#4.0.3
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"^4.0.3" from the root project
npm ERR! 2 more (jest-watcher, terminal-link)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional type-fest#"^0.13.1" from #pmmmwh/react-refresh-webpack-plugin#0.4.3
npm ERR! node_modules/#pmmmwh/react-refresh-webpack-plugin
npm ERR! #pmmmwh/react-refresh-webpack-plugin#"0.4.3" from react-scripts#4.0.3
npm ERR! node_modules/react-scripts
npm ERR! react-scripts#"^4.0.3" 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/johnnys/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/johnnys/.npm/_logs/2021-07-10T18_33_36_275Z-debug.log
You are getting the same type of error from a similar post about this issue npm audit fix --force never able to avoid vulnerabilities
There is also a closed ticket in GitHub create-react-app repo. Here is one of the answers:
Hi,
ensure that
your dependencies (including NodeJS/npm/npx/yarn) are up-to-date
ensure that CRA is not installed globally Follow
https://create-react-app.dev/docs/getting-started/ guide to get
started
You need probably keep updating the dependecies to the latest version and wait untill the latest release fix this issue.

ERESOLVE unable to resolve dependency tree for redux

I've tried with both --force and --legacy-peer-deps, but nothing seems to work. I'm currently using node#10.2.0 in macOS.
hiteshagarwal#Hiteshs-MBP kuber % npm i
(node:48924) ExperimentalWarning: The fs.promises API is experimental
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: client#0.1.0
npm ERR! Found: redux#4.1.0
npm ERR! node_modules/redux
npm ERR! redux#"^4.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer redux#"^2.0.0 || ^1.0.0" from redux-log-slow-reducers#0.0.2
npm ERR! node_modules/redux-log-slow-reducers
npm ERR! redux-log-slow-reducers#"0.0.2" 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/hiteshagarwal/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hiteshagarwal/.npm/_logs/2021-05-09T13_52_12_776Z-debug.log
After resolving the conflict issue with --legacy-peer-deps there was other many errors which were reflecting about node-gyp, gcc, const denominator, etc.
It’s resolved now. There was a conflict between the npm and node versions. I was using node 10.2.0 with npm 5.2.0 and some node-gyp cache files were also there from node 16.* version which was the reasons. I have cleaned the system with all the nvm, npm and node files and other caches and then reinstalled the node#10.2.0 from the web and it contains npm 5.6.* with which I was able to solve my issue.

npm chakra-ui install failing due to dependency conflicts

I'm trying to learn react/typescript and I'm following a tutorial line for line, but somehow getting this error when trying to install either #chakra-ui/react or #chakra-ui/core. It seems like a dependecy issue with react having been updated. Should I rollback react?
kyoudai.industries git:(master) ✗ npm install #chakra-ui/react framer-motion
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: kyoudai.industries#1.0.0
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR! peer react#"16.x || 17.x" from #chakra-ui/react#1.0.1
npm ERR! node_modules/#chakra-ui/react
npm ERR! #chakra-ui/react#"*" from the root project
npm ERR! 2 more (#emotion/react, #emotion/styled)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8" from framer-motion#2.9.4
npm ERR! node_modules/framer-motion
npm ERR! framer-motion#"*" from the root project
npm ERR! peer framer-motion#"^2.9.4" from #chakra-ui/react#1.0.1
npm ERR! node_modules/#chakra-ui/react
npm ERR! #chakra-ui/react#"*" 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/travis/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/travis/.npm/_logs/2020-11-24T22_38_57_297Z-debug.log
With this command you can solve the problem:
npm i #chakra-ui/react --legacy-peer-deps
I had the same issue but in Vue. I ran the following commands and it started working:
vue create test -p default && cd test && vue serve src/main.js,
It seems like it created a folder running some tests.
Then I ran: npm i -g #vue/cli-service-global..
Then: npm run serve-- to initiate the vue server.
Hopefully it gives you an idea how to solve that in React.
Good luck!

Resources