Can't install Next.js with Preact - node.js

I'm trying to install the Next.js/Preact.js setup from vercel and I get the following error:
> npx create-next-app --example using-preact using-preact-app
Need to install the following packages:
create-next-app
Ok to proceed? (y) y
Creating a new Next.js app in /home/somayyah/Documents/using-preact-app.
Downloading files for example using-preact. This might take a moment.
Installing packages. This might take a couple of minutes.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: using-preact#1.0.0
npm ERR! Found: react#0.0.3
npm ERR! node_modules/react
npm ERR! react#"npm:#preact/compat#^0.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.6.0 || ^17" from next#10.0.6
npm ERR! node_modules/next
npm ERR! next#"^10.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 /home/somayyah/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/somayyah/.npm/_logs/2021-02-13T17_16_32_165Z-debug.log
I tried setting up Preact by myself on another project and I had the same issue, how can I get around this?

I think this is a bug related to npx. i am using yarn create next-app --example using-preact using-preact-app and it is installed successfully but unfortunately it looks like the example is not working and throws the error Could not find module' webpack

Related

npm install fails - version mismatch

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!

Vue 2 build error - ERESOLVE unable to resolve dependency tree

I'm getting the following dependency issues centering around eslint when I try to build my Vue 2 app.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: vue-crm#2.2.3
npm ERR! Found: eslint#8.16.0
npm ERR! node_modules/eslint
npm ERR! dev eslint#">=7.5.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint#"^5.0.0 || ^6.0.0" from #typescript-eslint/parser#2.34.0
npm ERR! node_modules/#typescript-eslint/parser
npm ERR! dev #typescript-eslint/parser#"^2.26.0" from the root project
npm ERR! peer #typescript-eslint/parser#"^2.0.0" from #typescript-eslint/eslint-plugin#2.34.0
npm ERR! node_modules/#typescript-eslint/eslint-plugin
npm ERR! dev #typescript-eslint/eslint-plugin#"^2.26.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!
I have tried changing the eslint version in the package.json to several different versions but nothing resolves the issue.
I have also tried running npm install --save --legacy-peer-deps as suggested for this similar SO question and, though the build begins, it hangs shortly after at about half way through like so:
########⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠋ idealTree: timing idealTree Completed in 29424ms
I am particularly confused by the line npm ERR! Found: eslint#8.16.0. I don't know where this is being found and the version number that it complains about might change each time I try another one in the package.json.
I've been trying to fix this for a couple of days now without any luck. If anyone can tell me what is needed to resolve it I would be very grateful.

Npm unable to install template dependencies

I am currently trying to create-react-app with --template typescript but I am getting the following error:
Installing template dependencies using npm...
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: react#18.0.0
npm ERR! node_modules/react
npm ERR! react#"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"<18.0.0" from #testing-library/react#12.1.5
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^12.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 /Users/BrianKim/.npm/eresolve-report.txt for a full report.
I've tried updating npm as well as node, but cannot get create-react-app to work at all. Please let me know what I could do, thanks!
I just installed "yarn" using "npm install --global yarn" and after that I installed react using "yarn create react-app my-app --template typescript" and everything worked fine for me without errors.

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!

How do I fix this NPM dependency issue for react-native-spotify-remote

I'm having trouble figuring out how to resolve a dependency related issue I'm having. I'm trying to install the npm module react-native-spotify-remote within a fresh React Native project and I am getting the following error:
$ npx react-native init test && cd test
$ npm i --save react-native-spotify-remote
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: test#0.0.1
npm ERR! Found: react-native#0.63.3
npm ERR! node_modules/react-native
npm ERR! react-native#"0.63.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native#"^0.61.5" from react-native-spotify-remote#0.3.2
npm ERR! node_modules/react-native-spotify-remote
npm ERR! react-native-spotify-remote#"*" 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\xxx\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\xxx\AppData\Local\npm-cache\_logs\2020-11-15T13_40_38_674Z-debug.log
As I read this error, it seems to me that it is saying that react-native-spotify-remote has a dependency of react-native at version 0.61.5 or higher, and version 0.63.3 is installed. Does that not mean the dependency is satisfied? I know that by downgrading react-native to an earlier version, as used in their example app, I could probably resolve this issue, but I want to try understand why this won't work first and I would ideally like to use the latest version.
Using the --force or --legacy-peer-deps flags does not solve the issue either.
I've also opened an issue on the GitHub repo but no luck there so far either.
Looks like it’s a problem with Peer Dependencies with npm, try:
npm install --legacy-peer-deps

Resources