Home > Enterprise >  i am getting the following error while installing material-UI in vs code with npm WHAT SHOULD I DO?
i am getting the following error while installing material-UI in vs code with npm WHAT SHOULD I DO?

Time:06-11

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@"^16.8.0 || ^17.0.0" from @material-ui/[email protected] npm ERR! node_modules/@material-ui/core npm ERR! @material-ui/core@"*" 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\ayush tawar\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\ayush tawar\AppData\Local\npm-cache_logs\2022-06-10T07_31_54_848Z-debug-0.log PS C:\Users\ayush tawar\OneDrive\Desktop\twitter clone>

CodePudding user response:

Please try to do like this npm cache clean

and then

npm install -g node-gyp
npm install --g --production windows-build-tools

Error installing bcrypt with npm

You can also add --verbose flag at the end of npm install which will show more information about this issue. if second command will not work, then you should install python to your pc and install this one.

npm install --g  windows-build-tools

I believe if you will use ubuntu or mac os, it will be resolved maybe.

Or it could be node version issue, please upgrade node version.

CodePudding user response:

The package is not up to date for react 18. Just install it with --legacy-peer-deps, this will override the error checking.

npm install @material-ui/core --legacy-peer-deps

  • Related