簡體   English   中英

Nodejs - 如何在 ubuntu 中卸載舊版本的 nodejs 並安裝新版本的 nodejs

[英]Nodejs - how to uninstall older version of nodejs and install new version of nodejs in ubuntu

我的反應項目需要更新 nodejs。 那么我如何在 Ubuntu 16.04 中將我的節點 js 重新安裝到最新版本。

我當前的節點版本是

node -v
v6.0.0

我目前的 npm 版本是

npm -v
3.8.6

理想情況下,我想將我的 nodejs、node 和 npm 重新安裝到最新版本。

從 Ubuntu 卸載 NodeJS

該命令將刪除包但保留配置文件。

sudo apt-get remove nodejs
sudo apt-get autoremove

要刪除包和配置文件,請運行:

sudo apt-get purge nodejs
sudo apt-get autoremove

在 Ubuntu 上安裝 NodeJS

將 NodeJS PPA 添加到 Ubuntu

sudo apt-get install software-properties-common
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -

成功添加 NodeJS PPA 后,現在是使用以下命令安裝 NodeJS 的時候了。

sudo apt-get install nodejs

驗證 NodeJS 和 NPM 的版本

node -v
npm -v

更多信息: http : //www.rscoder.com/2020/04/how-do-i-completely-uninstall-nodejs.html

從 Ubuntu 卸載 NodeJS

  • sudo apt-get remove nodejs
  • sudo apt-get update

按照以下鏈接在 ubuntu 中安裝最新的 nodeJs

https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/

您安裝成功的那些,然后如果您想檢查節點版本,請使用以下命令。

node -v

你試過這個嗎?

sudo npm cache clean -f
sudo npm install -g n
sudo n 10.16.0

或者n latest安裝最新版本的節點。

按照以下鏈接在 ubuntu 中安裝和使用其他版本的 nodeJs

https://stackoverflow.com/a/59392965/9490901

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM