How to Update Node.js + NPM + Express All to Latest Versions
I’ll introduce how to update Node.js, npm, and Express all to their latest versions.
This article is based on the following GitHub Pull Request. Please check the Pull Request directly for the overall changes.
Update Node.js version to v10.16.3 & npm update · Pull Request #2 · codenote-net/expressjs-sandbox
For npm versions, please refer to the following commit. Since most were npm installed during initial Express project creation, I don’t think there are any special npm packages.
npm update [2019-10-07] · Pull Request #2 · codenote-net/expressjs-sandbox
$ nvm install --lts
Installing latest LTS version.
v10.16.3 is already installed.
Now using node v10.16.3 (npm v6.9.0)
Also change the version in the .node-version file if it exists.
diff --git a/.node-version b/.node-version
index d3a8b24..70047db 100644
--- a/.node-version
+++ b/.node-version
@@ -1 +1 @@
-v8.11.1
+v10.16.3
Update Node.js version to v10.16.3 & npm update · Pull Request #2 · codenote-net/expressjs-sandbox
$ npm install -g npm-check-updates
npm-check-updates --upgrade
npm install
This will create many diffs in package.json, but just run npm install without question and run automated tests or perform functional testing.
Update Node.js version to v10.16.3 & npm update · Pull Request #2 · codenote-net/expressjs-sandbox
That’s all from the Gemba.