Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Node 16 #11070

Closed
4 tasks done
achuinard opened this issue May 12, 2022 · 19 comments
Closed
4 tasks done

Support Node 16 #11070

achuinard opened this issue May 12, 2022 · 19 comments
Assignees
Labels

Comments

@achuinard
Copy link

Are you certain it's a bug?

  • Yes, it looks like a bug

Is the issue caused by a plugin?

  • It is not a plugin issue

Are you using the latest version?

  • Yes, I'm using the latest version

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

nodejs16.x is rolling out on AWS this week. While it hasn't been announced publicly, the runtime is available, and a public announcement is expected soon. Updating my serverless.yml to the following:

provider:
  name: aws
  runtime: nodejs16.x

Results in the following error when calling my HTTP function:

Warning: Warning: found unsupported runtime 'nodejs16.x' for function 'myAuthorizer'
Authorization function returned an error response: (λ: myAuthorizer)

If I flip the runtime back to nodejs14.x everything works no problem (even if actually using node 16 to run serverless).

How can this get fixed?

Service configuration (serverless.yml) content

provider:
  name: aws
  runtime: nodejs16.x

Command name and used flags

serverless offline start

Command output

Warning: Warning: found unsupported runtime 'nodejs16.x' for function 'myAuthorizer'
Authorization function returned an error response: (λ: myAuthorizer)

Environment information

Framework Core: 3.17.0 (local)
Plugin: 6.2.2
SDK: 4.3.2
@medikoo
Copy link
Contributor

medikoo commented May 12, 2022

@achuinard Framework supports Node.js v16, it's serverless-offline that does not, although they merged support recently -> dherault/serverless-offline#1396 it's just not published yet

@achuinard
Copy link
Author

Thanks for the quick response @medikoo.

@medikoo
Copy link
Contributor

medikoo commented May 12, 2022

@achuinard can we close it?

@glimmbo
Copy link

glimmbo commented Jun 30, 2022

I'm running serverless offline 8.8.0 and it still says nodejs16.x is unsupported. 🤷‍♂️

@pgrzesik
Copy link
Contributor

@glimmbo If you're experiencing issues with Node 16 please report at serverless-offline. I will close this issue as Framework core supports Node 16

@jpascoe
Copy link

jpascoe commented Sep 6, 2022

this is still happening form me using latest version of serverless
npm install -g serverless

at 'provider.runtime': must be equal to one of the allowed values [dotnet6, dotnetcore3.1, go1.x, java11, java8, java8.al2, nodejs12.x, nodejs14.x, provided, provided.al2, python3.6, python3.7, python3.8, python3.9, ruby2.7]

@jpascoe
Copy link

jpascoe commented Sep 6, 2022

https://www.serverless.com/framework/docs/guides/upgrading-v3

Service configuration
The default Lambda runtime has changed from NodeJS 12 to NodeJS 14, given this is now the default runtime recommended by AWS.

@jpascoe
Copy link

jpascoe commented Sep 6, 2022

Is the documentation out of date or is NodeJS 16 not supported yet

@pgrzesik
Copy link
Contributor

pgrzesik commented Sep 6, 2022

Hey @jpascoe - which part of the documentation are you referring to? Node 16 is supported, in v3 release there was a change of default runtime from Node 12 to Node 14, but nothing prevents you from setting Node 16 as your preferred runtime.

@LaTrita97
Copy link

I'm receiving that alert too @pgrzesik.

I have to upgrade the runtime from nodejs12.x to nodejs16.x, but I receive this alert from the console:
Warning: Invalid configuration encountered at 'provider.runtime': must be equal to one of the allowed values [dotnet6, dotnetcore3.1, go1.x, java11, java8, java8.al2, nodejs12.x, nodejs14.x, provided, provided.al2, python3.6, python3.7, python3.8, python3.9, ruby2.7]

I'm using version 3 of the framework, but I'm not able to deploy the functions with nodejs16.x, what can I do?

@medikoo
Copy link
Contributor

medikoo commented Sep 18, 2022

I'm using version 3 of the framework,

@LaTrita97 what does serverless --version show?

@LaTrita97
Copy link

@medikoo

Framework Core: 3.10.2 (local) 3.10.2 (global)
Plugin: 6.2.0
SDK: 4.3.2

Yesterday I noticed that if I deploy all the Lambda functions with sls deploy, in spite off the alert message, all the functions come deployed with the runtime nodejs16.x.

But if I try to deploy one single function with sls deploy -f functionName, it doesn't work.

Am I wrong something?

@medikoo
Copy link
Contributor

medikoo commented Sep 18, 2022

@LaTrita97 Ensure to rely on latest release (it's v3.22.0)

@LaTrita97
Copy link

Ok thanks @medikoo.
I'll update the version, likely this is the problem.

@LaTrita97
Copy link

LaTrita97 commented Nov 17, 2022

@medikoo I'm having some problems upgrading serverless to the latest version.

The current version I have is this

Framework Core: 3.10.2 (local) 3.10.2 (global)
Plugin: 6.2.0
SDK: 4.3.2

I'm running in the console npm install -g serverless@3.24.1 but after the upgrade, if I run serverless --version the result printed is

Framework Core: 3.10.2 (local) 3.10.2 (global)
Plugin: 6.2.0
SDK: 4.3.2

Could you please help me to figure out what I'm doing wrong?

PS. I also tried to run npm install -g serverless and npm install -g serverless@3.24.1 --force, but they didn't work out.

@medikoo
Copy link
Contributor

medikoo commented Nov 17, 2022

@LaTrita97 what which serverless is returning?

@medikoo
Copy link
Contributor

medikoo commented Nov 17, 2022

Nonetheless, you can ensure an upgraded version for a given service by installing it locally via npm install serverless

@LaTrita97
Copy link

The command sudo npm install -g serverless@3.22.0 is returning this:

npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated superagent@7.1.6: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731)

added 1 package, removed 4 packages, changed 402 packages, and audited 404 packages in 26s

67 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

@LaTrita97
Copy link

@medikoo thank you I've just successfully upgraded the framework locally, but I still continue to don't understand why doesn't work globally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants