We wanted to take this opportunity to remind you of our schedule and approach to Node.js release management. Read on to learn how to deploy them and to find out what's new.
Until yesterday, whenever you ran
now, we would give you the latest version of the Node.js 8.x branch. We made this decision because we highly valued the features Node 8 brought on (like async/await) for microservice development, one of the core usecases of Now.
With Node.js 8.9.0 becoming LTS (Long Term Support), you now get the best of both worlds: access to some of the most interesting features, combined with great stability and production readiness.
Moving forward, we've made the decision to always track LTS by default for our Node.js deployments.
Node.js 9.0.0 was also introduced yesterday. It features experimental support for HTTP/2
without needing to specify the
flag required in the 8.x branch.
Your Now deployments already support HTTP/2 (which is handled together with encryption by our load balancers), which means this new module will not be necessary to support incoming traffic. However, if you're making API calls to external services from your code, you'll likely see increased performance when turning on HTTP/2.
To use Node 8 in conjunction with the
http2 module, run a
now deployment with a script like this inside
"start": "node --expose-http2 server.js"
If you're using micro
, you can invoke the
file directly and pass custom flags a well:
"start": "node --expose-http2 ./node_modules/.bin/micro"
Starting with Node.js 9, however, this is no longer needed! To signal that you want to use this branch of node, specify
engines in your
With this in place, each time you deploy we'll fetch the latest version of the branch that we know about. This will retain your ability to rollback if problems were to occur, and you'll receive security updates and improvements as they become available.
You can, of course, also use the
engines flag to pin to a specific verison that you are confident your program runs correctly in.
Moving forward, your Now deployments will track the LTS branch of Node.js, which the project recommends for most production users.
Without changing anything about your projects, every time you deploy we'll fetch the latest version of that branch. You'll get the latest security updates and fixes automatically.
We will continue to make all the modern versions available to test experimental features (like the new
http2 module) by simply adjusting your
engines field like shown above.