whoru

学习、分享、交流、沉淀

安装

➜  ~ npm i nrm -g

使用

# 查看 nrm 内置的几个 npm 源
➜ ~ nrm ls
npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
* taobao - https://registry.npm.taobao.org/
nj ----- https://registry.nodejitsu.com/
npmMirror https://skimdb.npmjs.com/registry/
edunpm - http://registry.enpmjs.org/

# 切换源
➜ ~ nrm use cnpm
Registry has been set to: http://r.cnpmjs.org/

本文主要介绍如何使用 nvm 对 Node 的版本进行管理,当然你也可以选择另一个工具 n

安装或升级(参见这里

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

脚本的作用是将 nvm 仓库源码克隆到 ~/.nvm 下面,之后将环境变量添加到配置文件中,如:~/.bash_profile~/.zshrc~/.profile,或 ~/.bashrc

所以会用到 git 命令,如果没有 Git,请先安装。

阅读全文 »