How to Set Node Version?

Hi, I’m trying to deploy Node 18 but the ancillary lambda functions are still deploying as node 16. Why?

sst.config.ts contains the following:

    app.setDefaultFunctionProps({
        runtime: "nodejs18.x",

DevDependencies include:

"aws-cdk-lib": "2.101.1",
"constructs": "10.2.69",
"sst": "2.34.3",

Concerned that node 16 loses maintenance next year and that "runtime: “nodejs18.x” does not seem to be honored.

My main lambdas are deployed as 18 but some lambdas that include the name “CustomResourceHandler” are still node 16 even though they do receive updates from my deployments. What needs to happen to get everything to deploy as Node 18?

Hi, I really need an answer here if we expect to continue using the product. Is this the proper forum?

Are these CustomResourceHandler being deployed from an SQS or Eventbridge?

If you could provide a but more context into how they’re getting deployed it might help answering it

Hi Damien,

My-Frontend-Stack-CustomResourceHandlerXXXXXXXXX-XXXXXXXXXXXX. This appears to be related to S3 (to support the FrontEnd stack).

My-Auth-Stack-CustomResourceHandlerXXXXXXXX-XXXXXXXXXXXX.

My-Subscriptions-Stack-CustomResourceHandlerXXXXXXXX-XXXXXXXXXXXX

My-Storage-Stack-CustomResourceHandlerXXXXXXXX-XXXXXXXXXXXX

Here is an example of the FrontEnd Stack definition:

import {StaticSite, use} from “sst/constructs”;
import {ApiStack} from “./ApiStack”;

export function FrontendStack({stack, app}) {

let { api } = use(ApiStack);

// Define our React app
const site = new StaticSite(stack, "ReactSite", {
    path: "frontend",
    buildOutput: "build",
    buildCommand: "npm run build",
    // customDomain: scope.stage === "prod" ? "demo.serverless-stack.com" : undefined,
    // Pass in our environment variables
    environment: {
        REACT_APP_API_URL: api.customDomainUrl || api.url,
        REACT_APP_REGION: stack.region,
    },
});

// Show the url in the output
this.addOutputs({
    SiteUrl: site.customDomainUrl || site.url,
});

}

I don’t believe I’m creating any of the Node16 (CustomResourceHandler) Lambda functions directly. Believe they are all created by the SST framework.

What other information can I provide? What can be changed to get these to generate as Node18?

Really dying here. Why doesn’t the following statement deploy everything as Node 18?

app.setDefaultFunctionProps({
    runtime: "nodejs18.x",

Did you ever get a solution to this?

I’m facing the same problem but with trying to update from Node 18 to Node 20. Changing the runtime seems to only update the server Lambda. There are ancilliary Lambdas that sst is building that seem to be “hard code” to Node 18.

You need to update sst, equal or higher than 2.47.2. Please keep in mind that if you use setDefaultFunctionProps, it only affects when you run sst deploy, not sst dev