简体   繁体   English

为什么我的节点版本在我的 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 v10.19.0

$ npm -v

: not foundram Files/nodejs/npm: 3: : 未找到文件/nodejs/npm: 3:
: not foundram Files/nodejs/npm: 5: /mnt/c/Program Files/nodejs/npm: 6: Syntax error: word unexpected (expecting "in") :未找到ram Files/nodejs/npm:5:/mnt/c/Program Files/nodejs/npm:6:语法错误:单词意外(期待“in”)

I would recommend installing Node with nvm.我建议使用 nvm 安装 Node。

download NVM using following command on terminal在终端上使用以下命令下载 NVM
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash bash

verify nvm is installed using nvm --version使用nvm --version验证 nvm 是否已安装

install the required node version using nvm install 12.14.1 and then use the installed version using nvm use 12.14.1使用nvm install 12.14.1安装所需的节点版本,然后使用已安装的版本使用nvm use 12.14.1

Try running sudo apt-get update in your Ubuntu terminal.尝试在 Ubuntu 终端中运行sudo apt-get update

Then run sudo apt-get upgrade and look to see if any packages were modified.然后运行sudo apt-get upgrade并查看是否有任何软件包被修改。

If that doesn't work, try installing node.js directly from the command line using sudo apt-get install nodejs .如果这不起作用,请尝试使用sudo apt-get install nodejs Then check your version again with node -v and see if there are any changes.然后使用node -v再次检查您的版本,看看是否有任何更改。

Here'sa reference这是一个参考

Additionally, here is an article explaining in detail how to add both node and npm directly from the command line另外,这里有一篇文章详细解释了如何直接从命令行添加节点和 npm

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.我更喜欢尽可能使用命令行进行安装,尤其是在 Linux 的 Windows 子系统上,并不是每个 package 都兼容。 That should get you somewhere in this vicinity.这应该让你在附近的某个地方。 在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Ubuntu:Node 不会更新到最新版本 - Ubuntu: Node will not update to latest version 我的节点和 npm 已经是最新版本 - my node and npm are already latest version 为什么 npm 安装在我的设备上不起作用,即使我重新安装也无法查看版本详细信息? - Why is it that npm install doesn't work on my device and I am unable to view the version details even though I've reinstalled? 我确定我下载了节点最新版本,但在使用“node --Version”之后在 cmd 上,这是我得到的:node: bad option: --Version - I'm sure I downloaded the node latest version but on cmd after used "node --Version" and this what I got: node: bad option: --Version 我需要在节点 js 中加入巧克力吗?如果我安装了节点 js,我的 windows 会更新到最新版本吗? - do i need chocolatey in node js and will my windows update to latest version if I installed node js? docker 构建出现错误,检测到节点 v10,Angular CLI 需要 v12.14 或 v14.15 的最低 Node.js 版本 - docker build gives error, node v10 detected, The Angular CLI requires a minimum Node.js version of either v12.14 or v14.15 如何在 Ubuntu 上安装最新的节点版本? - How to install latest node version on Ubuntu? 使用终端 Linux Ubuntu 更改节点版本 - Change the version of node with the terminal Linux Ubuntu Angular CLI 在 ng 更新期间未检测到 NPM 版本(v10 --> v11) - Angular CLI doesn't detect NPM version during ng update (v10 --> v11) 当我的节点版本比请求的版本更新时,为什么会收到有关我的节点版本的错误? - Why am I getting an error about my node version when I have a newer version than is requested?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM