node.js - Running node in command line w/o sudo -


i installed nodejs on ubuntu server , i'm wondering why can't use typing "node". "nodejs" works fine, "node" should work, too, right? "sudo node" works well, thought might problem path, path variables identical:

root@myserver:/# node -v -bash: /usr/sbin/node: no such file or directory root@myserver:/# sudo node -v v8.2.1 root@myserver:/# echo $path /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games root@myserver:/# sudo echo $path /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games 

what doing wrong here? thx.

i have had issue in past. started installing node on ubuntu have never had issues using node command, has worked:

rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} curl -sl https://deb.nodesource.com/setup_8.x | sudo -e bash - sudo apt-get install -y nodejs 

let me know if works. can read more here: https://nodejs.org/en/download/package-manager/


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -