Session Log: Upgrading node version to 14+
$ node --version
v12.14.1
$ npm --version
6.14.14
$ npm cache clean -f
npm WARN using --force I sure hope you know what you are doing.
$ npm install -g n
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/lib/node_modules'] {
npm ERR! stack: "Error: EACCES: permission denied, access '/usr/lib/node_modules'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dpc/.npm/_logs/2021-08-03T21_18_21_456Z-debug.log
OK, it looks like we need to sudo this bee-yotch!
$ sudo npm install -g n
[sudo] password for dpc:
/usr/bin/n -> /usr/lib/node_modules/n/bin/n
+ n@7.3.1
added 1 package from 2 contributors in 0.121s
dpc@LT3-Insp17-2017:frontend$ sudo n stable
installing : node-v14.17.4
mkdir : /usr/local/n/versions/node/14.17.4
fetch : https://nodejs.org/dist/v14.17.4/node-v14.17.4-linux-x64.tar.xz
installed : v14.17.4 (with npm 6.14.14)
Note: the node command changed location and the old location may be remembered in your current shell.
old : /usr/bin/node
new : /usr/local/bin/node
To reset the command location hash either start a new shell, or execute PATH="$PATH"
$ node --version
v12.14.1
dpc@LT3-Insp17-2017:frontend$ npm --version
6.14.14
Huh! WTF? Why isn’t the newly-installed version in-play?
Let’s force an environment re-read:
$ source ~/.bashrc
$ npm --version
6.14.14
$ node --version
v14.17.4
OK, that looks like it worked.