nodejs的安裝和環境搭建

  1. 安裝npm。
npm的項目地址:
https://github.com/creationix/nvm/blob/master/README.markdown

直接從Github中將git clone nvm到本地。node

$ cd ~/git
$ git clone https://github.com/cnpm/nvm.git

配置終端啓動時自動執行 source ~/git/nvm/nvm.sh, 在 ~/.bashrc, ~/.bash_profile, ~/.profile, 或者 ~/.zshrc 文件添加如下命令:git

source ~/git/nvm/nvm.sh

從新打開你的終端, 輸入 nvmgithub

```
$ nvm

Node Version Manager   
Usage:

nvm help                    Show this message
nvm --version               Print out the latest released version of nvm
nvm install [-s] <version>  Download and install a <version>, [-s] from source
nvm uninstall <version>     Uninstall a version
nvm use <version>           Modify PATH to use <version>
nvm run <version> [<args>]  Run <version> with <args> as arguments
nvm current                 Display currently activated version
nvm ls                      List installed versions
nvm ls <version>            List versions matching a given description
nvm ls-remote               List remote versions available for install
nvm deactivate              Undo effects of NVM on current shell
nvm alias [<pattern>]       Show all aliases beginning with <pattern>
nvm alias <name> <version>  Set an alias named <name> pointing to <version>
nvm unalias <name>          Deletes the alias named <name>
nvm copy-packages <version> Install global NPM packages contained in <version> to current version
Example:
nvm install v0.10.24        Install a specific version number
nvm use 0.10                Use the latest available 0.10.x release
nvm run 0.10.24 myApp.js    Run myApp.js using node v0.10.24
nvm alias default 0.10.24   Set default node version on a shell

Note:
to remove, delete or uninstall nvm - just remove ~/.nvm, ~/.npm and ~/.bower folders

 ```
  1. 經過 nvm 安裝任意版本的 nodeshell

    安裝制定版本的nodejsnpm

    $ nvm install v6.7.0

    查看本機的版本信息bash

    $ nvm list

    查看全部的nodejs版本信息markdown

    $ nvm list-remote

    刪除指定版本this

    $ nvm uninstall v6.6.0
相關文章
相關標籤/搜索