Answer the question
In order to leave comments, you need to log in
How to install NVM for all users?
How to install NVM ( https://github.com/creationix/nvm) for all users?
Now it is installed only in the root folder (/root/.nvm).
If you try to install it from under any user, then there will be an error due to an attempt to install it in /root/.nvm, which, of course, is not available to the user.
Questions:
1) How to install NVM for a specific user?
2) How to install NVM for root so that node is accessible to all users?
The latter is more desirable, of course, so as not to produce nvm and a node for all users.
Answer the question
In order to leave comments, you need to log in
Installing Node.js and NVM for all users
======================================== =====
1. First you need to install NVM for the root user.
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | NVM_DIR=/usr/local/nvm bash
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | NVM_DIR=/usr/local/nvm bash
export NVM_DIR="/usr/local/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
Installing Node.js and NVM for all users
1. Install NVM for the root user.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash
https://nodejs.org/en/download/package-manager/#nvm
nvm install node
chmod 755 /root
chmod 755 /root/.nvm
su www-data
vim ~/.bashrc
export PATH=./node_modules/.bin:$PATH
export NVM_DIR="/root/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
exit
which node
ls -la /root/.nvm
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question