tl; dr
# Installs n and the latest LTS Node.js version to ~/n.
# For bash, ksh, zsh, modifies the respective user-specific shell-initialization file to
# define env. variable N_PREFIX and append $N_PREFIX/bin to the $PATH.
curl -L https://git.io/n-install | bash
我感觉到你的痛苦.正在安装 node .js安装n
,然后管理 node .js安装确实是一种奇怪的设置.
如果能先安装n
个,那就太好了.
我创造了一个100 to support installation of 101 directly from GitHub;only prerequisite beyond what 101 itself needs is 103.
请注意,必须首先删除任何预先存在的n
/ node .js版本
除了直接从GitHub安装n
之外,它还安装了用于更新n
(n-update
)和卸载它(n-uninstall
)的帮助程序脚本.
这里是working examples;详情请参见n-install GitHub repo:
安装时出现确认提示,确认安装到默认位置$HOME/n
并安装最新的LTS node .js版本:
curl -L https://git.io/n-install | bash
自动安装到默认位置,随后安装最新的LTS(长期支持)和最新的整体 node .js版本,以及最新的4.1.x node .js版本:
curl -L https://git.io/n-install | bash -s -- -y lts latest 4.1
自动安装到默认位置,然后安装一个 node .js版本:
curl -L https://git.io/n-install | bash -s -- -y -
自动安装到自定义位置~/util/n
,随后安装最新的LTS node .js版本:
curl -L https://git.io/n-install | N_PREFIX=~/util/n bash -s -- -y