1108

Nodejs多版本管理工具FNM

下载

Github仓库Releases: https://github.com/Schniz/fnm/releases

配置

配置环境变量

nodejs下载目录地址

FNM_DIR="D:\\Applications\\Nodejs"

配置下载源

FNM_NODE_DIST_MIRROR="https://mirrors.aliyun.com/nodejs-release/"

配置环境变量

.zshrc.bashrc

windows

eval $(fnm env | sed 1d)
export PATH=$(cygpath $FNM_MULTISHELL_PATH):$PATH

if [[ -f .node-version || -f .nvmrc ]]; then
   fnm use
fi

linux

FNM_NODE_DIST_MIRROR="https://mirrors.aliyun.com/nodejs-release/"
FNM_PATH="/home/<user_name>/.local/share/fnm"
if [ -d "$FNM_PATH" ]; then
  export PATH="$FNM_PATH:$PATH"
  eval "`fnm env`"
fi

或手动将 fnm env 输出的配置,加入到系统环境变量中