When I attempt to build react native program following its official website guideline on Mac, it gives me the following errors. Any suggestions about debugging?
npx react-native init A2 Need to install the following packages:
react-native#0.69.0 Ok to proceed? (y) y npm ERR! code ERESOLVE npm
ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving:
undefined#undefined npm ERR! Found: react-native#0.68.2 npm ERR!
node_modules/react-native npm ERR! peer react-native#"*" from
#react-native-community/cli#7.0.3 npm ERR!
node_modules/#react-native-community/cli npm ERR!
#react-native-community/cli#"^7.0.3" from react-native#0.68.2 npm ERR!
react-native#"0.69.0" from the root project npm ERR! npm ERR! Could
not resolve dependency: npm ERR! react-native#"0.69.0" from the root
project npm ERR! npm ERR! Conflicting peer dependency: react#18.0.0
npm ERR! node_modules/react npm ERR! peer react#"18.0.0" from
react-native#0.69.0 npm ERR! node_modules/react-native npm ERR!
react-native#"0.69.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/student/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in: npm ERR!
/Users/student/.npm/_logs/2022-06-25T16_09_36_906Z-debug-0.log
This is a problem with peer dependency on the latest node version. This command should solve the problem: npm config set legacy-peer-deps true. Take a look on this issue for reference: https://github.com/facebook/react-native/issues/34051#issuecomment-1198463785
Related
I am trying to run npm run dev for a Vue project but I keep getting the following output:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: babel-loader#7.1.5
npm ERR! Found: webpack#5.75.0
npm ERR! node_modules/webpack
npm ERR! peer webpack#"^5.0.0" from css-loader#6.7.2
npm ERR! node_modules/css-loader
npm ERR! dev css-loader#"^6.7.2" from the root project
npm ERR! peer webpack#"^5.20.0" from html-webpack-plugin#5.5.0
npm ERR! node_modules/html-webpack-plugin
npm ERR! dev html-webpack-plugin#"^5.5.0" from the root project
npm ERR! 8 more (postcss-loader, terser-webpack-plugin, url-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack#"2 || 3 || 4" from babel-loader#7.1.5
npm ERR! node_modules/babel-loader
npm ERR! dev babel-loader#"^7.1.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack#4.46.0
npm ERR! node_modules/webpack
npm ERR! peer webpack#"2 || 3 || 4" from babel-loader#7.1.5
npm ERR! node_modules/babel-loader
npm ERR! dev babel-loader#"^7.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.
I have no idea what to do, I have tried uninstalling vue-cli and tried re-installing it (I'm not sure if this messed up my packages). Is there a way to cleanly delete everything and start fresh? If anyone can help that would be much appreciated!
Update:
I tried starting a new project with vue init webpack frontend in a new folder and tried installing axios and am getting the following error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: vuex#4.1.0
npm ERR! Found: vue#2.7.14
npm ERR! node_modules/vue
npm ERR! vue#"^2.5.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue#"^3.2.0" from vuex#4.1.0
npm ERR! node_modules/vuex
npm ERR! vuex#"^4.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vue#3.2.45
npm ERR! node_modules/vue
npm ERR! peer vue#"^3.2.0" from vuex#4.1.0
npm ERR! node_modules/vuex
npm ERR! vuex#"^4.1.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.
I recently updated my version of node (v19.1.0) and npm (v8.19.3), could that be an issue? It generally seems like I am getting a bunch of conflicts every time I try to install new packages. Is there a way to just start clean?
Probably one of your packages is outdated, according to the error. I guess it's the babel loader.
Method 1 Upgrading or Updating your packages might solve the dependency error.
Method 2 Try running npm install --force or npm install --legacy-peer-deps. It should work.
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: my-app#0.0.0
npm ERR! Found: #angular/common#14.2.0
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"^14.2.3" from the root project
npm ERR! peer #angular/common#"14.2.0" from #angular/forms#14.2.0
npm ERR! node_modules/#angular/forms
npm ERR! #angular/forms#"^14.2.3" from the root project
npm ERR! 4 more (#angular/platform-browser, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! #angular/common#"^14.2.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #angular/core#14.2.3
npm ERR! node_modules/#angular/core
npm ERR! peer #angular/core#"14.2.3" from #angular/common#14.2.3
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"^14.2.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.
Ok I found the answer through angular communities, you just need to run this command on the terminal
ng update #angular/cli #angular/core
My project uses Chakra-UI and React. When trying to run npm install, I got this npm error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #choc-ui/chakra-autocomplete#5.1.2
npm ERR! Found: #chakra-ui/react#1.8.8
npm ERR! node_modules/#chakra-ui/react
npm ERR! #chakra-ui/react#"latest" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #chakra-ui/react#"^2.2.8" from #choc-ui/chakra-autocomplete#5.1.2
npm ERR! node_modules/#choc-ui/chakra-autocomplete
npm ERR! #choc-ui/chakra-autocomplete#"^5.1.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#18.2.0
npm ERR! node_modules/react
npm ERR! peer react#">=18" from #chakra-ui/react#2.3.5
npm ERR! node_modules/#chakra-ui/react
npm ERR! peer #chakra-ui/react#"^2.2.8" from #choc-ui/chakra-autocomplete#5.1.2
npm ERR! node_modules/#choc-ui/chakra-autocomplete
npm ERR! #choc-ui/chakra-autocomplete#"^5.1.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.
I don't understand this error, I tried deleting node_modules and package-lock.json, ran npm install again, but same error. Any ideas?
run again npm install --legacy-peer-deps that will solve your issue
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
I'm developing a react native application. Throughout the project I have used Node package manager to install the packages. But I ran into this dependency problem first time when I try to install react-native-styled-components with npm, so I installed it with yarn.
Now I can't install any package with node package manager, I run into this unable to resolve dependency tree error.
PS C:\Users\94774\OneDrive\React Projects\Native Projects\Android\socialmediaapp> npm install react#latest react-native#latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: socialmediaapp#0.0.1
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.1" from react-native#0.64.1
npm ERR! node_modules/react-native
npm ERR! react-native#"0.64.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 C:\Users\94774\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\94774\AppData\Local\npm-cache\_logs\2021-05-06T12_12_44_173Z-debug.log
PS C:\Users\94774\OneDrive\React Projects\Native Projects\Android\socialmediaapp> npm install --save #react-native-firebase/app
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: socialmediaapp#0.0.1
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.8.0" from styled-components#5.3.0
npm ERR! node_modules/styled-components
npm ERR! styled-components#"^5.3.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"17.0.2" from react-dom#17.0.2
npm ERR! node_modules/react-dom
npm ERR! peer react-dom#">= 16.8.0" from styled-components#5.3.0
npm ERR! node_modules/styled-components
npm ERR! styled-components#"^5.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\94774\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\94774\AppData\Local\npm-cache\_logs\2021-05-06T12_41_01_675Z-debug.log
npm install react-native-styled-components --legacy-peer-deps