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

升级Node.js至8.10后VS Code调试Node Lambda失败求助

Fixing Node-Lambda Debug Issue After Upgrading to Node.js 8.10 in VS Code

Let's break down what's going on here and fix that frustrating "Runtime [nodejs8.10] is not supported" error.

Root Cause

The problem isn't with VS Code—it's coming from your node-lambda tool. Older versions of node-lambda don't recognize Node.js 8.10 as a valid runtime, since they were built to work with older Node releases like 6.10. That's why the error popped up right after your Node version upgrade.

Step 1: Upgrade node-lambda to a compatible version

First, you need to get a newer version of node-lambda that supports Node 8.10.

  • Uninstall the outdated global version:
    npm uninstall -g node-lambda
    
  • Install the latest stable version:
    npm install -g node-lambda
    

If you're using node-lambda as a local project dependency instead of a global tool, update its version in your package.json and run npm install to pull in the new release.

Step 2: Fix your VS Code Debug Configuration

Your current config has the protocol line commented out—but Node.js 8.x relies on the inspector protocol for debugging. Update your launch config to enable this:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Debug Node Lambda ",
      "program": "/usr/local/bin/node-lambda",
      "args": [ "run" ],
      "preLaunchTask": "debug",
      "postDebugTask": "clean",
      "runtimeVersion": "8.10.0",
      "protocol": "inspector"
    }
  ]
}

Step 3: Explicitly Specify the Runtime (If Needed)

If you still see the error after upgrading, force node-lambda to use the correct runtime by adding it to your debug arguments:

Modify the args array in your config to:

"args": [ "run", "--runtime", "nodejs8.10" ]

Step 4: Double-Check Your Node Environment

Make sure VS Code is using the right Node 8.10 version managed by nvm:

  • Open the VS Code terminal and run node -v to confirm it outputs v8.10.0.
  • If it shows a different version, run nvm use 8.10.0 in the terminal to switch to the correct environment before starting the debugger.

That should get your VS Code debugger working smoothly with Node 8.10 and node-lambda again!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 04:05:10