Home>Article>Web Front-end> How to use nvm tool to manage node version? Method introduction
Related recommendations: "node js tutorial"
nvm is a popular way to run Node.js. For example, it makes it easy to switch Node.js versions, as well as install a new version to try out and easily roll back if something goes wrong.
This is useful for testing code with older versions of Node.js.
Execute brew install nvm, then the report:
//在命令行执行: mkdir ~/.nvm
//用vim打开该文件 vim ~/.zshrc //按i进入书写模式 把蓝色内容黏贴在下方 export NVM_DIR="$HOME/.nvm" [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm [ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" //按esc键 :wq保存退出 //此时再次执行brew install nvm还是如图一的报错。那是配置的.zshrc文件没生效。 //因此要在保存.zshrc文件后,在命令行执行使配置生效: source ~/.zshrc
Enter nvm again. At this time, nvm has been installed. Yes, as well as its information and commands
mark only For reference, corrections and additions are welcome. Thanks
For more programming-related knowledge, please visit:Programming Teaching! !
The above is the detailed content of How to use nvm tool to manage node version? Method introduction. For more information, please follow other related articles on the PHP Chinese website!