npm comes bundled with node, both parts of Node.js install --- no need to install separately
Below are the steps for installing Node.js from a source (OSX / linux). Issuing cmds as your own is NOT root (sudo)
to start fresh uninstall before node and npm installation, as well as the following:
sudo mv ~/.npmrc ~/.npmrc_ignore sudo mv ~/.npm ~/.npm_ignore sudo mv ~/tmp ~/tmp_ignore sudo mv ~/.npm-init.js ~/.npm-init.js_ignore
Download Source: http://nodejs.org/download/
cd freshly-downloaded-dir
define the NODE_PATH environment variable as a directory for subsequent installation modules
export NODE_PARENT=${HOME}/nodejs-v0.10.33 export PATH=${NODE_PARENT}/bin:${PATH} export NODE_PATH=${NODE_PARENT}/lib/node_modules ./configure --prefix=${NODE_PARENT} make make install # IMPORTANT this is NOT using sudo # not wanted since installing into $USER owned $NODE_PARENT
which puts it in the directory above --prefix
when you use the syntax: npm install -g some_cool_module -g for global installs it in the $ NODE_PATH directory, not your $ PWD
Now put the three exported xxx = yyy commands into your ~ / .bashrc or some of them to save these changes to the environment variables.
Scott Stensland
source share