genkio / blog

Stay hungry stay foolish
https://slashbit.github.io/blog/
0 stars 1 forks source link

Fix nvm command not found #6

Open genkio opened 8 years ago

genkio commented 8 years ago

Install nvm with curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash

Check to see if .nvm exists with ls -a | grep .nvm

If .nvm does not yet exist, try clone it from the github git clone http://github.com/creationix/nvm.git .nvm

Then add this line to the end of ~/.bash_profile (~/.profile) to fix nvm command not found issue. [[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM

Continue setup at #7

genkio commented 3 years ago

For nvm use default not stick between window to window

export NVM_DIR="/home/bonnie/.nvm"
## If the file exists and is not empty
if [ -s "$NVM_DIR/nvm.sh" ]; then
    ## Source it
    source "$NVM_DIR/nvm.sh"
fi
NODE_DEFAULT_VERSION=$(<"$NVM_DIR/alias/default")
export PATH="$NVM_DIR/versions/node/$NODE_DEFAULT_VERSION/bin":$PATH