0

Just wanted to post the steps I took after running into the following error when trying to run an Azure Function HTTP Trigger locally in VS Code:

"[error] Incompatible Node.js version. The version you are using is v13.1.0, 
 but the runtime requires an LTS-covered major version. LTS-covered versions 
 have an even major version number (8.x, 10.x, etc.) as per 
 https://github.com/nodejs/Release#release-plan. For deployed code, change 
 WEBSITENODEDEFAULT_VERSION to '~10' in App Settings. Locally, install or 
 switch to a supported node version (make sure to quit and restart your code 
 editor to pick up the changes)."

1 Answer 1

2

(1.) install NVM. Instructions here: https://github.com/nvm-sh/nvm#installing-and-updating

(2.) install NVS. Instructions here: https://github.com/jasongin/nvs

(3.) in your VS code terminal, run:

nvs add 12.16.1
nvs use node/12.16.1/x64

(4.) edit your launch.json to the following:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to Node Functions",
            "type": "node",
            "request": "attach",
            "port": 5555,
            "preLaunchTask": "func: host start"
        }
    ],
    "node": {
        "runtimeVersion": "12.16.1"
    }
}

(5.) in your VS code terminal, run:

func start
Sign up to request clarification or add additional context in comments.

1 Comment

What if I want to debug it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.