Node.js/nvm:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
 
第1行: 第1行:
== 源 ==
临时
{{shc|<syntaxhighlight lang="bash">
export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node/</syntaxhighlight>|$|/home/kangkk}}
或
{{hc|head=~/.bash_profile |output=<syntaxhighlight lang="bash">
export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node/
</syntaxhighlight>}}
{{shc|<syntaxhighlight lang="bash">
source ~/.bash_profile</syntaxhighlight>|$|/home/kangkk}}
== 引言 ==
== 引言 ==
[https://github.com/nvm-sh/nvm creationix/nvm] 是一个独立软件包。安装时需要在 nvm 项目上找到最新版本。
[https://github.com/nvm-sh/nvm creationix/nvm] 是一个独立软件包。安装时需要在 nvm 项目上找到最新版本。

2024年8月4日 (日) 14:14的最新版本

源

临时

/home/kangkk
export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node/

或

~/.bash_profile
export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node/
/home/kangkk
source ~/.bash_profile

引言

creationix/nvm 是一个独立软件包。安装时需要在 nvm 项目上找到最新版本。

/home/kangkk
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.38.0/install.sh | bash

配置环境变量。

/home/kangkk
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

列出远程服务器版本

列出远程服务器上所有的可用版本

 
nvm ls-remote

Windows

 
nvm ls available
// or
nvm list [available]

安装稳定版本

/home/kangkk
nvm install --lts