nvsbefore have been using
nvm windowsthis tool, with the also very cool, not long ago to see science text, so would like to try, then tried in
windowsa rollover, so here record it. First look at the popular science article: use nvs to manage the local Node.js version
git bash environment configuration
# ~/.bashrc # $ProgramData $LOCALAPPDATA export NVS_HOME=$LOCALAPPDATA/nvs . $NVS_HOME/nvs.sh
nvsCommand not found in git bash
choco install nvsafter installation can be used normally, but will be missing
nvs.shif you are
git bashunder use
nvswill not find the command, subsequent versions will fix the problem. The recommended cmd manual installation procedure does not have this problem.
npmcommand does not take effect
After installation, in a new terminal window
npmwhen it does not take effect, please log out and log in again, or restart the system once.
nvs linkafter the first use , the
npmwill not take effect. It is best to log out and log in again.
First of all, it is not recommended that you share global modules across versions unless you know what you are doing.
Popular science article: Use nvs to manage the local Node.js version Here is how to set it up.
# git bash mkdir -p ~/.npm-global npm config set prefix ~/.npm-global
# .bashrc # ~/.npm-global/ ~/.npm-global/bin # windows 10 bin echo "export PATH=~/.npm-global/:$PATH" >> ~/.bashrc source ~/.bashrc
- Pay attention to check whether the configuration path of the global module is correct (pit)
power shelladd global module environment variables under
Through the above configuration
git bash, the global installed
npmnormal work of the module, but in
power shellwill find not find the command, tried to add a system variable , but still does not take effect, put a final issues, the official gave the solution .
# setx PATH "%PATH%;%USERPROFILE%\.npm-global"
cygwinall in force
nvs useIs to change
nodeversion of the current window , not the global environment (the difference between nvm)
nvs linkIs the
nodeversion that changes the global environment