Trying to play with node and meteor in my own directory with invoking root privilege
By default all these packages will assume default of /usr/local. We need to change that
In .bash_profile, add:
export npm_config_prefix=$HOME/local # For npm
export PREFIX=$HOME/local
export N_PREFIX=$HOME/local # For n
Make sure the changes are in effect by running:
. ~/.bash_profile
For npm
- Download the install script from https://npmjs.org/install.sh. At the time of writing, this URL issues a 301 redirect, so we need the '-L' switch to follow the redirection. To specify the prefix, we need 'npm_config_prefix' (covered in .bash_profile)
curl -L https://npmjs.org/install.sh | /bin/sh
- Node is installed via npm and the prefix is specified by N_PREFIX (covered in .bash_profile)
- Install the versions
npm install -g n
n stable
npm install -g
means the package will be installed relative to the current locationReference: https://www.npmjs.org/doc/files/npm-folders.html
No comments:
Post a Comment