Back to Blog Home
← all posts

Which versions of Node.js should you use today

December 1, 2015 — by Todor Totev

NativeScript is how you build cross-platform, native iOS and Android apps without web views. Use Angular, TypeScript or modern JavaScript to get truly native UI and performance while sharing skills and code with the web. Get 100% access to native APIs via JavaScript and reuse of packages from NPM, CocoaPods and Gradle. Open source and backed by Telerik. If you'd like to give it a try, it is easy to get started.

As we know, NativeScript CLI is a Node.js application. This brings the questions like "which versions of Node.js can and should I use" or "how long а particular Node.js version is supported."

To answer these questions, it is useful to know the life cycle of Node.js. Please, take a minute to check the project wiki which explains it in a single graphic. With this in mind, the NativeScript team decided to support the LTS branches and, if possible, the "current stable" branch.

So, the first question has a simple answer: at the moment of writing, NativeScript is working on Node.js 0.10, 0.12, and 4.2. It also works with the stable 5.1 branch. On each of these branches the team tests against its latest released version.

The "which version should I use" question is easy too: the latest release in Long-term support branch, which at the time of writing is the 4.2 one.

Why it is chosen?

Because it offers the right blend of features and stability. For example, tests against some 0.12 releases discovered that TypeScript compilation is ten times slower compared to 4.2. This is very important when dealing with Angular 2 projects, which utilize TypeScript language to its full extent.

Another benefit is that Node 4 bundles npm v2, which is more mature than v1 bundled previously and significantly faster than npm v3, which comes with Node.js 5.1. For instance, on one of our machines, installing the CLI itself took 80 seconds less with Node 4 against Node 5.

Let's not forget that Node.js 4 works better with Windows 8 and 10, if this is your workstation of choice.

Being a LTS means that it receives first all the critical security fixes, which is important for software which is exposed to Internet.

Even Node.js maintainers state that "The Node.js core team will continue to ensure that v0.12 remains a viable platform for production deployment until the end of 2016. However, users of v0.12 should be working on plan to migrate to at least v4 LTS (Argon) as soon as practical."

To answer the last question ("how long a given version is supported"), we monitor the current share of the different Node.js versions. When one drops very low (in the single digits), we consider stopping testing against it, and thus our support. We warn about this at least one release in advance and, according the feedback we get, may extend its support.

To sum up, if you are using another version, we urge you to try Node.js 4.2 now!

Happy coding,

The NativeScript team