![](/img/trans.png)
[英]How to upgrade npm version to latest? Ubuntu shows successful install but doesn't upgrade version
[英]Node version doesn't change after attempted upgrade in Ubuntu
在我的Ubuntu計算機上,我正在嘗試更新我的Node版本。 我運行curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
然后我運行sudo apt-get install -y nodejs
在此之后,我的節點版本保持不變:
ubuntu:~$ node -v
v6.10.3
使用nvm,節點的版本管理器
https://github.com/creationix/nvm
要下載節點,請安裝nvm並鍵入nvm install <version>
這將同時下載節點和npm
要更改要使用的節點版本,請鍵入nvm use <version>
有關更多詳細信息,請查看倉庫^^
最終,運行此命令對我有用。
卸載:
sudo apt-get purge nodejs
sudo apt-get autoremove
nvm deactivate
nvm uninstall node_version
( 來源 )
安裝新版本:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
如果這里有錯誤,請運行以下2:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
wget -qO - https://raw.githubusercontent.com/yarnpkg/releases/gh-pages/debian/pubkey.gpg | sudo apt-key add -
安裝新版本的節點:
wget -qO - https://raw.githubusercontent.com/yarnpkg/releases/gh-pages/debian/pubkey.gpg | sudo apt-key add -
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.