Next build node runtime

From ai-shifu/ai-shifu · View interactive version

Next build node runtime is an AI agent skill from the GitHub repository ai-shifu/ai-shifu. Use when Cook Web npm run build fails with SyntaxError Unexpected token '?' or next/dist/compiled errors. Check for mismatched Node runtime versions first.

How to use this skill

Skill file

Next Build Node 运行时排障

触发条件

工作流

  1. 在当前目录分别检查运行时版本与路径:node -v、npm -v、which node、which npm。
  2. 对照 package.json 的 engines.node,确认是否匹配。
  3. 如果 shell 初始化脚本切到了旧 Node,先切到项目要求版本再重新执行 npm run build。
  4. 构建失败时只抓第一个 Error 作为阻断点,不把 Warning 当作失败原因。
  5. 若阻断点是 ESLint Error,做最小改动修复;保留调试日志,不删除 console.log。
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.