LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Deepin
User Name
Password
Linux Deepin This forum is for the discussion of Linux Deepin.

Notices


Reply
  Search this Thread
Old 08-17-2019, 12:46 AM   #1
RadioactiveButter
LQ Newbie
 
Registered: Aug 2019
Posts: 1

Rep: Reputation: Disabled
Unhappy Help installing node.js


Hey there, I'm new to Linux and Deepin is my first distro. I'm trying to install Node.js to work through a beginner project but I'm not able to figure out what I'm doing wrong.

I've downloaded the files from here. Then I extracted them and followed the node website's instructions, typing this into the terminal:

curl -sL https://deb.nodesource.com/setup_10.x | bash - apt-get install -y nodejs

Output is:

bash: curl: command not found

Next I tried just

apt-get install -y nodejs

The output read E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?


I get that it doesn't recognize "curl" but I don't know what that is supposed to mean in the first place. In the second output I'm guessing it means that the location it needs to install to is locked and I need to have admin privileges which I do but I don't know how to put that in terminal.

I'm sure this is really basic stuff, but I'm pretty stuck. Thank you for any help.
 
Old 08-17-2019, 11:03 PM   #2
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,349

Rep: Reputation: 517Reputation: 517Reputation: 517Reputation: 517Reputation: 517Reputation: 517
Do you have curl installed? Doesn't look like it.
Code:
whereis curl
which curl
Admin means root.
You get root with su or use sudo if configured.
See: man su

Did you configure a root account when you installed? And a user?
https://wiki.deepin.org
 
Old 08-18-2019, 02:55 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 12,533
Blog Entries: 9

Rep: Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393
Quote:
Originally Posted by RadioactiveButter View Post
curl -sL https://deb.nodesource.com/setup_10.x | bash - apt-get install -y nodejs
Ouch.
Bad command.
Let's go through this:
  • It downloads something (what? do you know what it does?) from the internet using curl.
  • then "pipes" it to bash (the pipe symbol: | ) which then executes it. Again, do you know what is being executed and why?
  • to make matters worse, it uses the apt-get install command with the '-y' switch, which means "just say yes to every question that requires user input". Seriously?
To make matters even worse, this won't work without elevated privileges, so I summarise:
A command to become root, download some random stuff from the internet and execute it, no questions asked.
Does that sound safe to you?

So how to do it properly?
  1. Make sure your system's up-to-date before you even start.
  2. Find the tutorial that tells you how to install nodejs
  3. erm, maybe nodejs is already in your distros repositories and you can install it from there instead? try 'apt search nodejs' and show us.
 
1 members found this post helpful.
Old 08-18-2019, 03:51 AM   #4
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,266

Rep: Reputation: 140Reputation: 140
RadioactiveButter,

You are just missing curl. Something that can download stuff using http(s). You can do this one of two ways. Do you know your root password? Did you provide it during install, or leave it blank?

If the former, then run the following command:

Code:
$ su -
And, enter that password.

Then install curl:

Code:
# apt install curl
Now you can follow those instructions again.

If you are using sudo (no root password), then do the following:

Code:
$ sudo apt install curl
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - apt-get install -y nodejs


ondoho,

Quote:
Originally Posted by ondoho View Post
So how to do it properly?
  1. Make sure your system's up-to-date before you even start.
  2. Find the tutorial that tells you how to install nodejs
  3. erm, maybe nodejs is already in your distros repositories and you can install it from there instead? try 'apt search nodejs' and show us.
Can I suggest that you perhaps read the documentation from nodejs's website on how to install on Debian. Specifically the part that talks about how NodeSource is the official source (as far as nodejs is concerned) of Debian nodejs packages, and that OP has pretty much copied their instructions verbatim. Also, note that the instructions has details on how to perform the installation manually should you (in their words) not be a fan of curl <url> | bash -. Also, note that these instructions reside in a git repo with the install script. Whilst your note may be good practice in the general sense, you've picked a really poor example to make your point.
 
Old 08-18-2019, 04:15 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 12,533
Blog Entries: 9

Rep: Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393Reputation: 3393
Quote:
Originally Posted by phil.d.g View Post
Can I suggest that you perhaps read the documentation from nodejs's website on how to install on Debian.
Yes, I also suggested this to OP. Before executing random commands with superuser privileges. Good point.

Quote:
Originally Posted by phil.d.g View Post
you've picked a really poor example to make your point.
Since OP is no doubt going to listen to you and not to me, let their success or failure, and their continued stability of their Mint installation, be the judge of that.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rhel 2 node cluster: resources do not move to second node when node halted tapuhi Linux - Software 1 03-01-2015 10:41 AM
node recovery when the node becomes fault by using another node to replace it jerinc Linux - Wireless Networking 0 02-21-2014 05:44 PM
How to transfer the services from node 1 to node 2 ,if node 1 is directly turned off sankarg304 Linux - Server 1 12-12-2012 10:06 AM
JavaScript:: alert(node) shows null, but node != null taylor_venable Programming 1 05-01-2006 09:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Deepin

All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration