Just use nvm and do not try other methods.
nvm
apt install nodejs-legacy npm curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash nvm install node nvm use default npm install npm@latest -g
Back To Top