Managing Multiple Node.js Versions

What if you already have Node.js installed, but not the right version? It’s possible to install and use multiple versions of Node.js with a tool called nvm.[107]

Using the nvm command, you can switch between different versions of Node.js, and even install them, with a single command. To install the version of Node.js that Lambda uses, you can run this command:

 $ ​​nvm​​ ​​install​​ ​​v4.3.2

And to use it, you can run this:

 $ ​​nvm​​ ​​use​​ ​​v4.3.2

You can have multiple versions installed at the same time, in case you’re working with different environments (a combination of Lambda and EC2, for example), or if you want to use a different version of Node.js for local tools than you do for testing Lambda ...

Get Serverless Single Page Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.