Node.js/n:修订间差异
来自康健生活
无编辑摘要 |
|||
| 第12行: | 第12行: | ||
sudo npm install n -g | sudo npm install n -g | ||
</syntaxhighlight>|$}} | </syntaxhighlight>|$}} | ||
{{ | |||
n -h | {{Shc_out|<syntaxhighlight lang="bash"> | ||
</syntaxhighlight>| | n -h</syntaxhighlight>|<syntaxhighlight lang="bash"> | ||
< | |||
Usage: n [options] [COMMAND] [args] | Usage: n [options] [COMMAND] [args] | ||
Commands: | Commands: | ||
n Display downloaded | n Display downloaded Node.js versions and install selection | ||
n latest Install the latest | n latest Install the latest Node.js release (downloading if necessary) | ||
n lts Install the latest LTS | n lts Install the latest LTS Node.js release (downloading if necessary) | ||
n <version> Install | n <version> Install Node.js <version> (downloading if necessary) | ||
n run <version> [args ...] Execute downloaded | 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 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 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 rm <version ...> Remove the given downloaded version(s) | ||
n prune Remove all downloaded versions except the installed version | n prune Remove all downloaded versions except the installed version | ||
n --latest Output the latest | n --latest Output the latest Node.js version available | ||
n --lts Output the latest LTS | n --lts Output the latest LTS Node.js version available | ||
n ls Output downloaded versions | n ls Output downloaded versions | ||
n ls-remote [version] Output matching versions available for download | n ls-remote [version] Output matching versions available for download | ||
n uninstall Remove the installed | n uninstall Remove the installed Node.js | ||
Options: | Options: | ||
| 第39行: | 第39行: | ||
-V, --version Output version of n | -V, --version Output version of n | ||
-h, --help Display help information | -h, --help Display help information | ||
-p, --preserve Preserve npm and npx during install of | -p, --preserve Preserve npm and npx during install of Node.js | ||
-q, --quiet Disable curl output | -q, --quiet Disable curl output. Disable log messages processing "auto" and "engine" labels. | ||
-d, --download Download | -d, --download Download if necessary, and don't make active | ||
-a, --arch Override system architecture | -a, --arch Override system architecture | ||
--all ls-remote displays all matches instead of last 20 | --all ls-remote displays all matches instead of last 20 | ||
| 第49行: | 第49行: | ||
Aliases: | Aliases: | ||
install: i | |||
latest: current | |||
ls: list | ls: list | ||
lsr: ls-remote | lsr: ls-remote | ||
lts: stable | |||
rm: - | rm: - | ||
run: use, as | |||
which: bin | |||
Versions: | Versions: | ||
| 第66行: | 第67行: | ||
lts Newest Long Term Support official release | lts Newest Long Term Support official release | ||
latest, current Newest official release | latest, current Newest official release | ||
auto Read version from file: .n-node-version, .node-version, .nvmrc, or package.json | |||
engine Read version from package.json | |||
boron, carbon Codenames for release streams | boron, carbon Codenames for release streams | ||
and nightly | lts_latest Node.js support aliases | ||
</ | |||
查看 node | and nightly, rc/10 et al | ||
{{ | </syntaxhighlight>|➜ font.xxx.org git:(backend) ✗}} | ||
which node</syntaxhighlight>|$}} | |||
查看 node 当前安装路径。 | |||
{{Shc_out|<syntaxhighlight lang="bash"> | |||
which node | |||
</syntaxhighlight>|<syntaxhighlight lang="bash"> | |||
/usr/local/bin/node | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
{{shc|<syntaxhighlight lang="bash"> | {{shc|<syntaxhighlight lang="bash"> | ||
sudo apt-get remove nodejs</syntaxhighlight>|$}} | sudo apt-get remove nodejs</syntaxhighlight>|$}} | ||