即使我通過瀏覽器下載了最新的穩定版本,為什麼我的 ubuntu 終端 v10 中的節點版本仍然存在? (Why is my node version in my ubuntu terminal v10 even though I downloaded the latest stable version through browser?)


問題描述

即使我通過瀏覽器下載了最新的穩定版本,為什麼我的 ubuntu 終端 v10 中的節點版本仍然存在? (Why is my node version in my ubuntu terminal v10 even though I downloaded the latest stable version through browser?)

$ node ‑v

v10.19.0

$ npm ‑v

: not foundram Files/nodejs/npm: 3:
: not foundram Files/nodejs/npm: 5 : /mnt/c/Program Files/nodejs/npm: 6: 語法錯誤:單詞意外(期待“in”)


參考解法

方法 1:

I would recommend installing Node with nvm.

download NVM using following command on terminal curl ‑o‑ https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash

verify nvm is installed using nvm ‑‑version

install the required node version using nvm install 12.14.1 and then use the installed version using nvm use 12.14.1

方法 2:

Try running sudo apt‑get update in your Ubuntu terminal.

Then run sudo apt‑get upgrade and look to see if any packages were modified.

If that doesn't work, try installing node.js directly from the command line using sudo apt‑get install nodejs. Then check your version again with node ‑v and see if there are any changes.

Here's a reference

Additionally, here is an article explaining in detail how to add both node and npm directly from the command line

I prefer whenever possible to use the command line for installs, especially on Windows subsystem for Linux where not every package is compatible just yet. That should get you somewhere in this vicinity. enter image description here

(by Ryan Christopher EDQUILADeepak Poojarikillshot13)

參考文件

  1. Why is my node version in my ubuntu terminal v10 even though I downloaded the latest stable version through browser? (CC BY‑SA 2.5/3.0/4.0)

#npm #windows-subsystem-for-linux #node.js






相關問題

TFS 構建中的 npm install 拋出“未找到:git” (npm install in TFS build throws "not found: git")

找不到模塊“電子” (Cannot find module 'electron')

使用 npm 進行生成器角度安裝時出現問題 (Trouble during generator-angular installation with npm)

使用 node.js 從谷歌云存儲中刪除多個對象 (Delete multiple objects fron google cloud storage using node.js)

VS Task Runner Explorer - Node Sass 找不到綁定 (VS Task Runner Explorer - Node Sass could not find a binding)

有什麼東西可以跟踪我安裝的 npm 包並在不同的開發環境中恢復它們嗎?(如“恢復 NuGet 包”) (Is there anything that can keep track of my installed npm packages and restore them on a different dev environment ? (like "Restore NuGet packages"))

角度材質工具欄不繼承自角度材質 (Angular material toolbar not inheriting from angular materials)

npm install throws 和錯誤告訴 node 不是一個可識別的命令 (npm install throws and error telling node is not a recognized command)

從代理後面登錄的無服務器框架? (Serverless Framework Login From Behind a Proxy?)

構建工具結構 - NPM、Grunt 和 Wordpress (Build tools structure - NPM, Grunt with Wordpress)

如何解決 Linux 中的“npm ERR!code ELIFECYCLE”錯誤? (How to solve "npm ERR! code ELIFECYCLE" error in Linux?)

如何在 Angular 中導入“數字”:“^1.2.6”? (How to import "numeric": "^1.2.6" in Angular?)







留言討論