Lyndon Li's Blog

Use nvm to manage node

Lyndon NodejsStudy

使用NVM来管理node的版本,并使用国内镜像安装

Node

安装NVM

从GITHUB获取最新链接

  • Use curl install

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
    
    • or use wget bash wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

设置环境变量使用国内node镜像

  • Set nvm mirrors

    $ vim ~/.bashrc
    # set nodejs env
    export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
    
    • Take it effect bash $ source ~/.bashrc
  • Set npm mirrors

    $ npm config set registry https://registry.npm.taobao.org
    
Lyndon
一个保持清醒的沉睡者