reactjs - Next.js error: "You are using Node.js 18.15.0. For Next.js, Node.js version >= 18.17.0 is required&

I recently created a Next.js app using the CLI, and when I tried to run the development server with npm

I recently created a Next.js app using the CLI, and when I tried to run the development server with npm run dev, I encountered this error:

You are using Node.js 18.15.0. For Next.js, Node.js version >= 18.17.0 is required.

However, my actual Node.js version is 20.10.0, which is clearly higher than the required version.

Here’s what I’ve tried so far:

  • Verified my Node.js version with node -v: v20.10.0
  • Checked nvm list: showing v22.5.1 and system Node.js versions.

I’m not sure why Next.js is picking up an older version of Node.js. How do I fix this?

I recently created a Next.js app using the CLI, and when I tried to run the development server with npm run dev, I encountered this error:

You are using Node.js 18.15.0. For Next.js, Node.js version >= 18.17.0 is required.

However, my actual Node.js version is 20.10.0, which is clearly higher than the required version.

Here’s what I’ve tried so far:

  • Verified my Node.js version with node -v: v20.10.0
  • Checked nvm list: showing v22.5.1 and system Node.js versions.

I’m not sure why Next.js is picking up an older version of Node.js. How do I fix this?

Share Improve this question asked Nov 15, 2024 at 21:41 aharoJaharoJ 2881 gold badge3 silver badges10 bronze badges 2
  • This Q/A is similar: stackoverflow/questions/77772200/… – Roar S. Commented Nov 15, 2024 at 22:34
  • You need to check the node version in the same command prompt. For example if you are getting the error in vs code terminal you need to check the node version in the vs code terminal as well. – davood Sandoghsaz Commented Nov 16, 2024 at 11:13
Add a comment  | 

1 Answer 1

Reset to default 0

I Think that there is Two Node versions on you machine you could try to list all node versions npm -g ls Alternatively you could uninstall npm and make sure no npm on your machine then install it again versions npm -g rm Then install it again

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745669702a4639333.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信