July 14, 2021 . 1 MIN READ
https://www.digizol.com/2017/08/nodejs-install-no-root-sudo-permission-linux-centos.html
sudo apt-get update && sudo apt-get install nodejs npm
whoami
groups
sudo chmod 777 -R /usr/local && sudo chgrp $(whoami) -R /usr/local
npm install -g npm
You are allset, your user can run npm commands without sudo
You can also refer to npm throws error without sudo.