Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node not working on Bash on Ubuntu on Windows

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

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

I have done apt-get install on node

# 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?

like image 392
Klas Mellbourn Avatar asked Sep 18 '16 09:09

Klas Mellbourn


People also ask

How do I enable bash on Ubuntu Windows?

Enable the new Bash on Ubuntu on Windows 1 – Right click on the Start icon and select Programs and Features. 2 – Click Turn Windows features on or off. 3 – Scroll down to the new Windows subsystem for Linux and tick it, click OK. 4 – Wait for it to apply and reboot when prompted.

Why is node not working in the terminal?

Make sure the node path is added, if not added it. After doing this restart Visual Studio or open a fresh command prompt. From the command prompt type 'node -v' to echo the node version installed. You can also add the path to node or any other application directly on the command line.

Why npm is not working in CMD?

The error “npm is not recognized as an internal or external command” error may occur because either the npm is not installed or it is not added to the windows path. To resolve this error, the first solution is to install Node. js on Windows as Node. js is equipped with npm by default.

Can I use node from WSL?

Configure a WSL-based Node.You can set a Node. js installation as the default interpreter for the current project or you can configure and use this Node. js version in a Node. js Run/Debug configuration.


1 Answers

To install NodeJS in ubuntu, install nodejs package:

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

The package node is not related to NodeJS.

like image 145
masoud Avatar answered Sep 24 '22 02:09

masoud