sudo command in node js code example
Example 1: linux install node
sudo apt install nodejs
Example 2: linux install node
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
Example 3: node sudo nvm
n=$(which node); \
n=${n%/bin/node}; \
chmod -R 755 $n/bin/*; \
sudo cp -r $n/{bin,lib,share} /usr/local