Open gv-beemining opened 5 years ago
Is $HOME
the same as /root
?
Separately, there shouldn't be any need to symlink node/npm into /usr/bin; when nvm is used, it's available in the PATH (and nodejs
isn't a binary name anyone should ever be using)
yes $HOME is the same as /root
without the symlinks i can't use npm from the dockerfile, it says npm: command not found
The dockerfile has to source nvm.sh
to have nvm working properly.
I'd use $HOME
then instead of ~
or /root
Operating system and version: Ubuntu 16.04
nvm debug
output:How did you install
nvm
? (e.g. install script in readme, Homebrew):Docker installation
Create a docker file then install NVM
script is not working with "~" home directory in path
Hi im trying to install NVM in a docker image with
Install nvm with node and npm
RUN mkdir -p ~/.nvm ENV NODE_ENV development ENV NVM_DIR /root/.nvm ENV NODE_VERSION 10.16.0 RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash RUN source $NVM_DIR/nvm.sh \ && nvm install $NODE_VERSION \ && nvm alias default $NODE_VERSION \ && nvm use default RUN ln -sf /root/.nvm/versions/node/v$NODE_VERSION/bin/node /usr/bin/nodejs RUN ln -sf /root/.nvm/versions/node/v$NODE_VERSION/bin/node /usr/bin/node RUN ln -sf /root/.nvm/versions/node/v$NODE_VERSION/bin/npm /usr/bin/npm RUN npm install pm2 -g RUN npm install nodemon -g
but if i use ENV_NVM_DIR as ~/.nvm it fails with the next error
You have $NVM_DIR set to "~/.nvm", but that directory does not exist. Check your profile files and environment.