You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

创建Svelte项目时npx调用旧Node版本报错的排查与解决

Node.js版本冲突导致Svelte项目创建失败的问题与解决
  • 当前使用的Node.js版本为20.18.1,但通过CLI创建Svelte项目时,npx调用了旧版本16.14.2,引发如下引擎不兼容报错:
npm warn cli npm v10.8.2 does not support Node.js v16.14.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/.
│  npm error code EBADENGINE
│  npm error engine Unsupported engine
│  npm error engine Not compatible with your version of node/npm: @sveltejs/kit@2.8.3
│  npm error notsup Not compatible with your version of node/npm: @sveltejs/kit@2.8.3
│  npm error notsup Required: {"node":">=18.13"}
│  npm error notsup Actual:   {"npm":"10.8.2","node":"v16.14.2"}
│  npm error A complete log of this run can be found in: /Users/ludwighenriques/.npm/_logs/2024-11-25T14_07_02_924Z-debug-0.log

2024年11月26日更新:

  • 卸载16.14.2版本后报错依旧,排查发现Mac根目录下与.nvm同路径的位置存在node_modules文件夹(此前误在此目录执行过npm install)
  • 删除该node_modules文件夹后,问题彻底解决

内容的提问来源于stack exchange,提问作者Ludwig HENRIQUES

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 03:10:59