node.js - Why does node is not available to all users with NVM? -


it's newbie question i'm wondering why when install node nvm, available user (it's not "global").

let's i'm log server user "admin":

curl https://raw.githubusercontent.com/creationix/nvm/v0.7.0/install.sh | sh source ~/.profile  nvm install 0.10.30 nvm use 0.10.30  node -v # outputs v0.10.30 

node , running user when switch root:

su node -v 

it displays:

the program 'node' can found in following packages:  * node  * nodejs-legacy try: apt-get install <selected package> 

why that? there way install node , make available users? (i don't want reinstall every time need new user.)

the problem nvm installs node.js user's local directory, , updates user's .profile.

here's 1 line script can copy install /usr/local/bin, can use node.js:

https://www.digitalocean.com/community/tutorials/how-to-install-node-js-with-nvm-node-version-manager-on-a-vps

n=$(which node);n=${n%/bin/node}; chmod -r 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -