Surviving the npm ERR! 404 with private packages

How to fix a common issue when installing private packages with npm

nasty problem maker
npm login
sudo npm i -g -D @organizationName/cli
sudo npm i -g -D @organizationName/cli
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@organizationName%2fcli - Not found
npm ERR! 404
npm ERR! 404 '@organizationName/cli@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a npm
ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-02-19T18_05_38_311Z-debug.log
Photo by bruce mars on Unsplash
npm install npm@latest -g
sudo npm i -g -D @organizationName/cli
npm ERR! code E404
npm config set registry http://registry.npmjs.org
Photo by Francisco Gonzalez on Unsplash
npm config set registry https://npm.organizationName.io/usrNameHere/
npm config set registry http://registry.npmjs.org
Photo by Tom Pumford on Unsplash
rm /home/colleagueName/.npmrc
Photo by bruce mars on Unsplash
Photo by Javier Allegue Barros on Unsplash

Web & Product Developer ~ R&D lover ~ Startup enthusiast