egg/docs/source/guide/installation.md
2016-09-04 14:57:32 +08:00

932 B
Raw Blame History

title: Installation

Installation

The best way to install node is nvm in OS X and Linux, or nvmw in Windows.

Don't use sudo.

After install nvm, you can install node.

$ nvm install 4

You can switch version that is installed.

$ nvm use 4
$ node -v
$ nvm use 6
$ node -v

Global module

Global module is the module that is installed with -g flag. You can share global modules between multi version.

If you are using nvm, it will switch prefix when switch versions. But you can specify prefix to use one global module between versions.

  1. Edit ~/.npmrcappend prefix=~/.npm-global
  2. Edit ~/.zshrc or ~/.bashrcappend export PATH=~/.npm-global/bin:$PATH
  3. Run source ~/.zshrc or source ~/.bashrc