0

I want to install nodejs in Linux from command prompt. I am using

wget http://nodejs.org/dist/v15.6.0/node-v15.6.0-linux-x64.tar.gz

but getting error

--2021-01-15 16:15:42--  http://nodejs.org/dist/v15.6.0/node-v15.6.0-linux-x64.tar.gz
Resolving nodejs.org (nodejs.org)... 134.60.42.42, 124.90.21.16, 6606:4760:10::1214:163e, ...
Connecting to nodejs.org (nodejs.org)|134.60.42.42|:80... failed: Connection timed out.
Connecting to nodejs.org (nodejs.org)|134.60.42.42|:80...

How can I fix this error?

3
  • Try to add verbose mode and also increase timeout, also it's possible that you are behind a proxy and you are not allowed to access internet. Commented Jan 15, 2021 at 16:42
  • @RedaSalih - Yeah I am behind the proxy but I have updated proxy settings. Is there alternate way to install node. Commented Jan 15, 2021 at 16:50
  • Try using a package manager as suggested in the below answer using node js official repositories Commented Jan 15, 2021 at 17:01

2 Answers 2

2

There is plenty of options to download node binary and install from there:

As GAD3R suggest you can use curl,

Or you can also install via package manager, in this link information for different Linux distributions: NodeJS Package Manager Installation

Please also refer to this section for more info NodeJS Download

E.g: apt install nodejs

8
  • It's not about only downloading, I want to install in VM via commnad prompt. Commented Jan 15, 2021 at 16:58
  • package-manager will handle the download and install for you? If you are in Linux-debian distro could you try apt install nodejs You could also check If you can install nvm Commented Jan 15, 2021 at 17:02
  • It is saying apt: invalid flag install for both nodejs and nvm. Commented Jan 15, 2021 at 17:07
  • Try this, taken from another answer: `sudo apt-get autoremove sudo apt-get install -f`` askubuntu.com/a/141374 Then. try to do installation again Commented Jan 15, 2021 at 17:20
  • apt-get not working. I tried with yum, first one worked, for second it said no such option -f. Commented Jan 15, 2021 at 17:26
1

Use curl:

curl https://nodejs.org/dist/v15.6.0/node-v15.6.0-linux-x64.tar.gz --output nodejs.tar.gz
5
  • I'm not sure how is this going to help? Commented Jan 15, 2021 at 16:51
  • I tried this but getting error ` --:--:-- 0:03:33 --:--:-- 0curl: (7) Failed to connect to 2606:4700:10::6824:272e: Network is unreachable` Is there other way to install node. Commented Jan 15, 2021 at 16:51
  • @ArvindChourasiya: the are problems with your network settings, all tools will fail. Commented Jan 15, 2021 at 16:52
  • @ArkadiuszDrabczyk - I am using VDI not local machine. In VDI browser I can access sites only which is allowed not like news wallpaper or node.org etc. In the same VDI I have VM. I needed to do few changes related to proxy, I did. Now I am expecting I should be able to install nodejs. Many things getting failed which is related to downloading something. I am using Putty. Commented Jan 15, 2021 at 16:55
  • Can I fix this adding 134.60.42.42|:80 in proxy or something Commented Jan 15, 2021 at 17:10

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.