node-and-npm-no-sudo (reference: https://gist.github.com/isaacs/579814)
#installing node in a custom directory so you don't have to use sudo all the time | |
#npm now comes with node, so no need to individually install it | |
cd ~ | |
mkdir local | |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.zshrc | |
. ~/.zshrc | |
cd local | |
#download latest Source Code from https://nodejs.org/en/download/ | |
#unzip folder and paste folder in /local directory | |
#rename folder (remove version number) to "node" | |
#cd into the node folder | |
cd node | |
#configure the prefix for the local folder you created | |
#remember to change the path to your actual path | |
./configure --prefix=/Users/yourusernamehere/local | |
make install | |
cd .. | |
#check node and npm versions to make sure they installed correctly | |
node -v | |
npm -v |
This comment has been minimized.
This comment has been minimized.
Hi Jamie, "command not found" -- did you add the PATH to your .bash_profile or .zshrc or .bashrc? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
ran this and got:
Jamies-iMac:ok jhw$ node -v
-bash: node: command not found
Jamies-iMac:ok jhw$ npm -v
-bash: npm: command not found
the local directory was empty? was node supposed to symlink it's ~ directory into there?
Thanks,
Jamie