Search code examples
node.jsgitnpmtwiliotwilio-programmable-chat

Failed API Request 82007 unsupported runtime: node16


following the steps from: https://www.twilio.com/en-us/blog/call-gpt-twilio#Deploy-functions after i put in: npm run deploy this error popped up: ERROR Failed API Request 82007 │ │ unsupported runtime: node16 │ │ More info: https://www.twilio.com/docs/errors/82007

I found out that twilio only supports node18: https://www.twilio.com/docs/serverless/functions-assets/faq#which-runtimes-are-available-for-twilio-functions

what should i do for me to get it to work?


Solution

  • You can specify the used Node version in these places:

    1. To use Node 18 locally, you can edit the .nvmrc file.
    16
    

    This won't fix the issue but it will ensure you use the same version for deployment and local testing

    1. But the error you are seeing is caused by the metadata described in .twilioserverlessrc and package.json
    "runtime": "node16"     /* The version of Node.js to deploy the build to. (node16) */,
    
    "engines": {
      "node": "16"
    }
    

    Change the version to 18 in all these files and then try to redeploy.