skip to Main Content

npm ERR! code ERESOLVE

npm ERR! ERESOLVE could not resolve

npm ERR!

npm ERR! While resolving: [email protected]

npm ERR! Found: [email protected]

npm ERR! node_modules/react

npm ERR! react@"^18.2.0" from the root project

npm ERR! peer react@"^18.2.0" from [email protected]

npm ERR! node_modules/react-dom

npm ERR! react-dom@"^18.2.0" from the root project

npm ERR! 1 more (react-icons)

npm ERR!

npm ERR! Could not resolve dependency:

npm ERR! peer react@"^16.8.0 || ^17.0.0" from [email protected]

npm ERR! node_modules/radium

npm ERR! radium@"^0.26.2" from the root project

npm ERR!

npm ERR! Conflicting peer dependency: [email protected]

npm ERR! node_modules/react

npm ERR! peer react@"^16.8.0 || ^17.0.0" from [email protected]

npm ERR! node_modules/radium

npm ERR! radium@"^0.26.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!

npm ERR! For a full report see:

npm ERR! /vercel/.npm/_logs/2023-08-22T11_11_53_352Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:

npm ERR! /vercel/.npm/_logs/2023-08-22T11_11_53_352Z-debug-0.log

Error: Command "npm install" exited with 1

and my package.json like this:

{


"name": "portfolio",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview"
  },
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-icons": "^4.10.1",
    "react-typed": "^1.2.0"
  },
  "devDependencies": {
    "@types/react": "^18.2.15",
    "@types/react-dom": "^18.2.7",
    "@vitejs/plugin-react": "^4.0.3",
    "autoprefixer": "^10.4.15",
    "eslint": "^8.45.0",
    "eslint-plugin-react": "^7.32.2",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.4.3",
    "postcss": "^8.4.28",
    "tailwindcss": "^3.3.3",
    "vite": "^4.4.5"
  }
}

can anyone help? what is the source and reason of the error and what should i do i don’t understand anything

2

Answers


  1. Try to use

    npm i --legacy-peer-deps
    
    Login or Signup to reply.
  2. Check NPM and Node version

    node -v
    npm -v
    

    if node found try to install it
    set registry

    npm config set registry https://registry.npmjs.org
    

    Clean cache

    npm cache clean --force
    

    then again try to install it

    npm i --legacy-peer-deps
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search