node.jsserverlessserverless-framework

Your Nodejs version is too old, please upgrade to Node 18 or newer and rerun Serverless


We came across this suddenly this week where we were building and deploying to lambda in automation:

"Your Nodejs version is too old, please upgrade to Node 18 or newer and rerun Serverless"


Solution

  • This appears to be related to release v4 of serverless. I'm not ready to upgrade so my "fix" was to remove a global install of serverless that I had in my ci scripts.

    npm install -g serverless
    

    Instead I've explicitly added serverless version 3.34.0 to my package.json devDependencies and now use npx whenever I use serverless from my npm scripts. npx is I'm sure not a necessary change but it's what I did here:

    e.g.

        "deploy-test": "serverless deploy -s test",
    

    becomes:

        "deploy-test": "npx serverless deploy -s test",
    

    Cheers.