跳至主要內容

升级 node

悟空约 174 字小于 1 分钟...

升级 node

下载node
https://nodejs.org/zh-cn/about/previous-releasesopen in new window

拷贝到 /usr/local/node$
tar -Jxf node-v16.20.2-linux-x64.tar.xz

编辑环境变量
sudo vim /etc/profile
export NODE_HOME=/usr/local/node/node-v16.20.2-linux-x64
export PATH=NODEHOME/bin:PATH
export NODE_PATH=$NODE_HOME/lib/node_modules

$ source /etc/profile
$ node -v

方式二

https://www.cnblogs.com/jackson0714/p/node.htmlopen in new window

安装 nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.shopen in new window | bash

报错:
fatal: unable to access 'https://github.com/nvm-sh/nvm.git/open in new window': gnutls_handshake() failed: The TLS connection was non-properly terminated.
Failed to clone nvm repo. Please report this!
解决方案

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.shopen in new window | bash

报错:
fatal: unable to access 'https://github.com/nvm-sh/nvm.git/open in new window': Failed to connect to github.comopen in new window port 443: Connection timed out
Failed to clone nvm repo. Please report this!

取消全局代理:
git config --global --unset http.https://github.com.proxyopen in new window
git config --global --unset http.https://github.com.proxyopen in new window
git config --global --unset http.proxy
git config --global --unset https.proxy

安装 nvm
安装 nvm
nvm 立即生效
nvm 立即生效

升级

n stablecurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.shopen in new window | bash

评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v3.3.0