Home > Mobile >  Build Failed Command "npm install" exited with 1
Build Failed Command "npm install" exited with 1

Time:09-13

so since the project started the deploy never had a problem, and out of nowhere today this message started to appear on vercel...

the application was coded using next js

I searched and searched and couldn't find a solution that worked for me...

Cloning github.com/ThiagoC0STA/kfk (Branch: main, Commit: f69b855)
Cloning completed: 1.077s
Looking up build cache...
Build Cache not found
Running "vercel build"
Vercel CLI 28.2.2
Installing dependencies...
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@"^17.0.2 || ^18.0.0-0" from [email protected]
npm ERR!   node_modules/next
npm ERR!     next@"12.2.5" from the root project
npm ERR!   5 more (react-dom, react-slick, styled-components, styled-jsx, use-sync-external-store)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"15 - 17" from [email protected]
npm ERR! node_modules/react-elastic-carousel
npm ERR!   react-elastic-carousel@"^0.11.5" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"15 - 17" from [email protected]
npm ERR!   node_modules/react-elastic-carousel
npm ERR!     react-elastic-carousel@"^0.11.5" 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 /vercel/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /vercel/.npm/_logs/2022-09-12T18_11_25_601Z-debug-0.log
Error: Command "npm install" exited with 1

package.json

{
  "name": "kfk",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "12.2.5",
    "next-images": "^1.8.4",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-elastic-carousel": "^0.11.5",
    "react-slick": "^0.29.0",
    "slick-carousel": "^1.8.1",
    "styled-components": "^5.3.5"
  },
  "devDependencies": {
    "babel-plugin-styled-components": "^2.0.7",
    "eslint": "8.22.0",
    "eslint-config-next": "12.2.5"
  }
}

I don't understand why I have this error out of the blue, since I've been deploying for weeks and this started out of nowhere.

CodePudding user response:

Try running

npm install --legacy-peer-deps

CodePudding user response:

If it's necessary, you can try to use --force

npm install --force

Here was the docs Npm install --force

  • Related