Last active
January 14, 2016 09:49
-
-
Save monsteronfire/adcfd633aa78cfb72c60 to your computer and use it in GitHub Desktop.
node-and-npm-no-sudo (reference: https://gist.github.com/isaacs/579814)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
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
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