FAQ - nodeschool/fort-worth GitHub Wiki
How do I get rid of these EACCESS errors?
We recommend using a tool called Node Version manager (nvm). NVM will manage multiple versions of Node for you, and will install each version a .nvm
folder in your home directory to prevent the permissions errors common in a standard Node install within /usr/local/bin
.
Steps
- Uninstall current version of Node
- These steps are going to vary depending on how original installation method, several methods are outlined in this stack overflow post
- Standard node install:
sudo rm -rf /usr/local/bin/node /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node opt/local/include/node /opt/local/lib/node_modules
- Install latest version of nvm
- The command will complain if you don't have a .bashrc or .bash_profile in your home directory. If you do not, open a terminal and type
touch ~/.bash_profile
- Run the curl install, version may be more current on the nvm Github repository
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
- Close your terminal session completely (Command+Q) and re-open your terminal
- Running
nvm
should produce the default help documentation
- The command will complain if you don't have a .bashrc or .bash_profile in your home directory. If you do not, open a terminal and type
- Install node with NVM
- Run
nvm install node
to get the latest version of node. At this point you have a fully functional version of node installed aliased as the 'default'. It will be available every time you start a bash session. - If you want a specific version, you can run
nvm install {version}
. The nvm utility will then allow you to switch between them withnvm use {version}
. Please see the nvm documentation for more advanced usage.
- Run
- Profit?