- 采用rust编写的nvm,完全兼容nvm-windows 完全实现nvm的功能,且扩充对linux和mac的支持。扩充了命令,优化了list打印
-
拉取代码,并编译
git clone git@github.com:youlingdada/nvm-rs.git
cd nvm-rs
cargo build --release
- 对于linux 和 mac 系统,如安装到/usr/local/nvm文件下
- 移动可执行文件到对应的目录
sudo mv target/release/nvm-rs /usr/local/nvm/nvm
- 写入setting.txt配置
echo "root: /usr/local/nvm" | sudo tee "/usr/local/nvm/settings.txt" echo "symlink: /usr/local/nvm/node" | sudo tee -a "/usr/local/nvm/settings.txt"
- 设置环境变量
# zsh echo "export NVM_HOME=/usr/local/nvm" >> ~/.zshrc echo "export NVM_SYMLINK=/usr/local/nvm/node" >> ~/.zshrc source ~/.zshrc # bash echo "export NVM_HOME=/usr/local/nvm" >> ~/.bash_profile echo "export NVM_SYMLINK=/usr/local/nvm/node" >> ~/.bash_profile source ~/.bash_profile
- 移动可执行文件到对应的目录
- windows
- 安装Inno Setup Compilter,并编译install/win/install.iss
- 运行生产的安装执行文件setup/nvm-rs-setup.exe
- 可以直接打开Inno Setup Compilter编译,也可配置好Inno Setup Compilter环境变量后运行install/win/build.cmd
install/win/build.cmd
- 运行install/linux/install.sh脚本安装
chmod +x install/linux/install.sh
sudo sh install/linux/install.sh
- 运行 install/mac/install.zsh
chmod +x install/mac/install.zsh
sudo zsh install/mac/install.zsh