alias Alias a version to a common name completions Print shell completions to stdout current Print the current Node.js version default Set a version as the default version env Print and set up required environment variables for fnm exec Run a command within fnm context help Print this message or the help of the given subcommand(s) install Install a new Node.js version list List all locally installed Node.js versions [aliases: ls] list-remote List all remote Node.js versions [aliases: ls-remote] unalias Remove an alias definition uninstall Uninstall a Node.js version use Change Node.js version
三、node版本管理(Linux)
n模块是用来安装各个版本的node的一个工具
1、安装n
1 2
npm install -g n n -V #查看n版本
2、管理node版本
1 2 3 4 5 6 7 8 9 10 11
n ls #查看当前已存在的node版本 n run 版本号 #切换到指定node版本
n 版本号 #下载指定版本node n install 版本号 #同上 n lts #下载最新的稳定版本
n Display downloaded Node.js versions and install selection n latest Install the latest Node.js release (downloading if necessary) n lts Install the latest LTS Node.js release (downloading if necessary) n <version> Install Node.js <version> (downloading if necessary) n install <version> Install Node.js <version> (downloading if necessary) n run <version> [args ...] Execute downloaded Node.js <version> with [args ...] n which <version> Output path for downloaded node <version> n exec <vers> <cmd> [args...] Execute command with modified PATH, so downloaded node <version> and npm first n rm <version ...> Remove the given downloaded version(s) n prune Remove all downloaded versions except the installed version n --latest Output the latest Node.js version available n --lts Output the latest LTS Node.js version available n ls Output downloaded versions n ls-remote [version] Output matching versions available for download n uninstall Remove the installed Node.js
Options:
-V, --version Output version of n -h, --help Display help information -p, --preserve Preserve npm and npx during install of Node.js -q, --quiet Disable curl output. Disable log messages processing "auto" and "engine" labels. -d, --download Download if necessary, and don't make active -a, --arch Override system architecture --all ls-remote displays all matches instead of last 20 --insecure Turn off certificate checking for https requests (may be needed from behind a proxy server) --use-xz/--no-use-xz Override automatic detection of xz support and enable/disable use of xz compressed node downloads.
Aliases:
install: i latest: current ls: list lsr: ls-remote lts: stable rm: - run: use, as which: bin