skip to Main Content

so the problem is when i create next js app,the node said that i still use older node version:

npm v10.5.2 does not support Node.js v16.20.2. This version of npm supports the following node versions: ^18.17.0 || >=20.5.0. You can find the latest version at https://nodejs.org/.
while i use nvm for switching in different version node,here my nvm ls:

`user@ss:~$ nvm ls
       v16.20.2
->     v18.20.2
       v20.13.1
         system
default -> v18.20.2
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.13.1) (default)
stable -> 20.13 (-> v20.13.1) (default)
lts/* -> lts/iron (-> v20.13.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.2
lts/iron -> v20.13.1`

i already set my default node to:
18.20.2 or 20.13.1

here’s my node -v:
v18.20.2

but whenever i try to create next-js app,the error said:

npm v10.5.2 does not support Node.js v16.20.2. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.

I want try to install next-js app and swtiching node with nvm is working

2

Answers


  1. Chosen as BEST ANSWER

    [Solved] I uninstall and delete node package that installed globally in system,and just using nvm instead


  2. Please check the package.json if there is a "engine" option.

    {
      ...
      "engines": {
        "node": "16.20.2"
      }
      ...
    }

    If there’s, please remove it or update to >=16.20.2 or greater than.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search