节点无法在 Windows 上的 Ubuntu 上使用 Bash

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39555949/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 15:12:07  来源:igfitidea点击:

node not working on Bash on Ubuntu on Windows

node.jsbashubuntuwindows-10

提问by Klas Mellbourn

I am trying to make node work inside Bash on Ubuntu on Windows.

我正在尝试使节点在 Windows 上的 Ubuntu 上的 Bash 中工作。

I am just starting out with using Bash on Ubuntu on Windows, so I am probably doing some newbie mistake.

我刚开始在 Windows 上的 Ubuntu 上使用 Bash,所以我可能犯了一些新手错误。

I have done apt-get installon node

我已经完成apt-get installnode

# sudo apt-get install node
Reading package lists... Done
[...]

That command gives reasonable output.

该命令给出了合理的输出。

But when I actually try to run the command I get no response whatsoever. No error message, nothing

但是当我实际尝试运行该命令时,我没有得到任何响应。没有错误信息,什么都没有

# node -v
# node
#

What am I doing wrong?

我究竟做错了什么?

采纳答案by masoud

To install NodeJS in ubuntu, install nodejspackage:

要在 ubuntu 中安装 NodeJS,请安装nodejs包:

wget -qO- https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get install nodejs

The package nodeis not related to NodeJS.

该包node与 NodeJS 无关。