安装nodejs

你知唔知我系靓仔

安装nodejs

使用 apt 安装 NodeJS

$ sudo apt install nodejs npm -y

使用 PPA 安装 NodeJS

$ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
$ sudo apt update -y
$ sudo apt install nodejs -y

使用 NVM 安装 NodeJS

$ curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
$ source ~/.profile
$ nvm ls-remote
$ nvm install 20.6

阿里源证书过期没有更新,影响拉取,改为使用腾讯源

npm config set registry https://mirrors.cloud.tencent.com/npm

**淘宝 NPM 镜像(https://npm.taobao.org/)**:
这是一个由淘宝提供的 NPM 镜像。你可以通过将 npm 的 registry 设置为 https://registry.npm.taobao.org/ 来使用。

**腾讯 NPM 镜像(https://mirrors.cloud.tencent.com/npm)**:
腾讯云提供的 NPM 镜像,也是一个常用的选择。你可以将 npm 的 registry 设置为 https://mirrors.cloud.tencent.com/npm。

**华为 NPM 镜像(https://mirrors.huaweicloud.com/repository/npm)**:
华为云提供的 NPM 镜像,也是一个可选的镜像源。你可以将 npm 的 registry 设置为 https://mirrors.huaweicloud.com/repository/npm。

**清华大学 TUNA 源(https://npm.tuna.tsinghua.edu.cn/)**:
清华大学开源软件镜像站提供的 NPM 镜像,是一个稳定可靠的选择。你可以将 npm 的 registry 设置为 https://npm.tuna.tsinghua.edu.cn/registry/。

**网易 NPM 镜像(https://mirrors.163.com/npm/)**:
网易提供的 NPM 镜像,也可以作为一个备选方案。你可以将 npm 的 registry 设置为 https://mirrors.163.com/npm/。