Upgrading NodeJS (on Windows)

As briefly mentioned in the prior entry, the NodeJS class instructor revved the version number of his course (resetting my progress but that’s more a side note). This new version of the course also switched to the latest version of node for the time: 11.0.0 (in the brief time since, NodeJS has moved to 11.1.0).

I’ve grown accustomed to applications obviously intended for Linux and other Unix-likes not having a lot of effort put into them when ported to Windows. So you can imagine my surprise upon installing the MSI of NodeJS 11.1.0 (this main and preferred way of upgrading NodeJS versions, at least when Chocolatey isn’t already an option).

Not only is it very well put together and seemingly Windows-oriented, it adds a number of Windows elements and very efficiently and elegantly installs the required dependencies.

Once the MSI has done its thing, there is a check box to install the rest of the required items automatically and a link with instructions on doing so manually. It is unchecked by default, which I appreciated.

I checked the box and clicked the “finish” button. A CMD window opened with the following text:

Tools for Node.js Native Modules Installation Script

This script will install Python and the Visual Studio Build Tools,
 necessary to compile Node.js native modules. Note that Chocolatey 
and required Windows updates will also be installed.

This will require about 3 Gb of free disk space, plus any space 
necessary to install Windows updates. This will take a while to 
run.

Please close all open programs for the duration of the 
installation. If the installation fails, please ensure Windows is 
fully updated, reboot your computer and try to run this again. This 
script can be found in the Start menu under Node.js.

You can close this window to stop now. Detailed instructions to 
install these tools manually are available at 
https://github.com/nodejs/node-gyp#on-windows

Press any key to continue . . .

I do appreciate the effort of explaining the next steps and how much possible storage space it will require. And also that it doesn’t try to explain what Chocolatey is. Just fortunate I am already am familiar.

Upon pushing a key to continue, the next screen:

Using this script downloads third party software

This script will direct to Chocolatey to install packages. By using 
Chocolatey to install a package, you are accepting the license for 
the application, executable(s), or other artifacts delivered to 
your machine as a result of a Chocolatey install. This acceptance 
occurs whether you know the license terms or not. Read and 
understand the license terms of the packages being installed and 
their dependencies prior to installation:

 https://chocolatey.org/packages/chocolatey
 https://chocolatey.org/packages/python2
 https://chocolatey.org/packages/visualstudio2017-workload-vctools 

This script is provided AS-IS without any warranties of any kind

Chocolatey has implemented security safeguards in their process to 
help protect the community from malicious or pirated software, but 
any use of this script is at your own risk. Please read the 
Chocolatey's legal terms of use as well as how the community 
repository for Chocolatey.org is maintained.

Press any key to continue . . .

This also lets me know in a relatively quick and straight forward way what’s going to happen and what will be installed.

Below is the tail end of the results screen when all the installing is complete. I was quite impressed the installer opened a CMD screen, launched into a PowerShell screen and proceeded to install chocolatey then used chocolatey to install the python 2 runtimes and the visualstudio dependencies without any further prompts, permissions, pauses or escalation account requirements. This is really the way such installs should be happening with Windows. Doesn’t hurt that chocolatey itself worked wonderfully well. As you can see below a few other runtimes and Windows updates were also installed.

visualstudio2017buildtools has been installed.
visualstudio2017buildtools may be able to be automatically 
uninstalled.

The upgrade of visualstudio2017buildtools was successful.

Software installed to '"C:\Program Files (x86)\Microsoft Visual 
Studio\Installer"'

 visualstudio2017-workload-vctools v1.3.1 [Approved]
 visualstudio2017-workload-vctools package files upgrade completed. 
Performing other installation steps.

 Installing visualstudio2017-workload-vctools...
 visualstudio2017-workload-vctools has been installed.
visualstudio2017-workload-vctools may be able to be automatically 
uninstalled.
The upgrade of visualstudio2017-workload-vctools was successful.

Software install location not explicitly set, could be in package 
or  default install location if installer.

 Chocolatey upgraded 16/16 packages.
See the log for details 
(C:\ProgramData\chocolatey\logs\chocolatey.log).
 Upgraded:
 kb2919355 v1.0.20160915
 visualstudio2017-workload-vctools v1.3.1
 chocolatey-core.extension v1.3.3
 dotnetfx v4.7.2.20180712
 vcredist140 v14.16.27027.1
 kb2919442 v1.0.20160915
chocolatey-visualstudio.extension v1.8.0
 chocolatey-windowsupdate.extension v1.0.3
 kb3033929 v1.0.4
 visualstudio2017buildtools v15.9.8.0
 vcredist2017 v14.16.27027.1
 dotnet4.6.2 v4.6.01590.20190226
 kb3035131 v1.0.2
 kb2999226 v1.0.20181019
 python2 v2.7.16
 visualstudio2017-installer v1.0.2 

 Enjoy using Chocolatey? Explore more amazing features to take your
 experience to the next level at 
https://chocolatey.org/compare

This turned into something of a review/commentary on the process for installing NodeJS on Windows. It was supposed to be just an establishment of what happens when installing NodeJS 11+ and the apparently only way to upgrade from an older version to NodeJS 11.

I assume upgrading Node versions from now on will be easier since I have Chocolatey now. I should probably write an entry about Node, NPM, Chocolatey and other related things in the specific context of Windows.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s