Next.js Discord

Discord Forum

Node version update from 14.x to 18.16.1

Unanswered
Satin posted this in #help-forum
Open in Discord
SatinOP
hi

5 Replies

SatinOP
hello guys, i need to update my project node version from 14.x to 18.x because of vercel deployment requirement on node version. But after update my node version to 18.16.1, when i try npm install i have this error:

'Log files:
/Users/deniz/.npm/_logs/2023-07-06T13_56_23_869Z-debug-0.log

# npm resolution error report

While resolving: finedine-website@1.0.0
Found: react@17.0.2
node_modules/react
  react@"17.0.2" from the root project
  peer react@"^17.0.2 || ^18.0.0-0" from next@12.2.0
  node_modules/next
    next@"12.2.0" from the root project
    peer next@">=2" from next-routes@1.4.2
    node_modules/next-routes
      next-routes@"1.4.2" from the root project
  peer react@"17.0.2" from react-dom@17.0.2
  node_modules/react-dom
    react-dom@"17.0.2" from the root project
    peer react-dom@"^17.0.2 || ^18.0.0-0" from next@12.2.0
    node_modules/next
      next@"12.2.0" from the root project
      peer next@">=2" from next-routes@1.4.2
      node_modules/next-routes
        next-routes@"1.4.2" from the root project

Could not resolve dependency:
peer react@"^15.4.2 || ^16" from next-routes@1.4.2
node_modules/next-routes
  next-routes@"1.4.2" from the root project

Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
i tried npm install --legacy-peer-deps then i can run the project but i want to send my package-lock.json to my master branch. When i try this i can see the same errors on the vercel deployment log.

This is the log error of vercel deployment:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: next-routes@1.4.2
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR!   peer react@">=16.3.0" from @emotion/core@10.3.1
npm ERR!   node_modules/@emotion/core
npm ERR!     @emotion/core@"^10.0.9" from react-select@3.2.0
npm ERR!     node_modules/react-select
npm ERR!       react-select@"^3.1.0" from @bambulabs/finedine-mobile-core-ui-kit@1.9.15
npm ERR!       node_modules/@bambulabs/finedine-mobile-core-ui-kit
npm ERR!         @bambulabs/finedine-mobile-core-ui-kit@"^1.6.1" from the root project
npm ERR!   16 more (@headlessui/react, @heroicons/react, next, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.4.2 || ^16" from next-routes@1.4.2
npm ERR! node_modules/next-routes
npm ERR!   next-routes@"1.4.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR!   peer react@"^15.4.2 || ^16" from next-routes@1.4.2
npm ERR!   node_modules/next-routes
npm ERR!     next-routes@"1.4.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-07-06T13_45_23_145Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR!     /vercel/.npm/_logs/2023-07-06T13_45_23_145Z-debug-0.log
Error: Command "npm install" exited with 1
and this is my dependencies in webpack:

"dependencies": {
    "@aws-sdk/client-firehose": "^3.53.0",
    "@bambulabs/finedine-mobile-core-ui-kit": "^1.6.1",
    "@headlessui/react": "1.7.8",
    "@heroicons/react": "^1.0.6",
    "aws-amplify": "^4.3.15",
    "aws-amplify-react": "^5.1.9",
    "axios": "^0.21.1",
    "classnames": "^2.3.1",
    "cookies-next": "^2.0.4",
    "js-cookie": "^3.0.1",
    "luxon": "^2.3.0",
    "next": "12.2.0",
    "next-routes": "1.4.2",
    "next-translate": "^1.3.3",
    "nextjs-progressbar": "^0.0.13",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-gtm-module": "^2.0.11",
    "react-hubspot-form": "^1.3.7",
    "react-icons": "^4.3.1",
    "react-is": "17.0.2",
    "react-items-carousel": "^2.8.0",
    "react-progressive-loader": "^0.4.1",
    "react-spring": "^8.0.27",
    "react-youtube": "^7.13.1",
    "uuid": "^9.0.0"
  },
do you have any suggestion to fix that? I dont understand the deployment errors, to me my dependencies okay to deploy

"engines": {
    "node": "18.16.1"
  },


but i dont understand these dependencies error from the libraries my react version is matched with the version that written in there (in error log)