Score:0

How to solve NodeJs Ubuntu download issue

us flag

I wanted to try host a website through AWS using Ubuntu 18.04 LTS, however I came across this issue when I tried to download Node.js on Ubuntu.

ubuntu@ip-172-31-16-206:~$ node -v

Command 'node' not found, but can be installed with:

sudo apt install nodejs

ubuntu@ip-172-31-16-206:~$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
>>> /etc/sudoers: syntax error near line 9 <<<
sudo: parse error in /etc/sudoers near line 9
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

In order to try resolve this syntax error I did this,

ubuntu@ip-172-31-16-206:~$ pkexec visudo
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/sbin/visudo' as the super user
Authenticating as: Ubuntu (ubuntu)
Password:

I tried entering the password that I usually used when accessing ubuntu so for example username@Desktop-123:~$ and it didn't work. I initially thought perhaps I entered it incorrectly but I didn't because when I shut the ubuntu down and started it again and used the password on username@Desktop-123:~$. It worked fine so the password is correct.

Can anyone suggest ways to solve this problem or other ways to install NodeJS on Ubuntu?. I would truly appreciate it.

ubuntu@ip-172-31-16-206:~$ pkexec visudo
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/sbin/visudo' as the super user
Authenticating as: Ubuntu (ubuntu)
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized

This is what happens when I enter my password even though I know it is correct so I'm not sure what this is referring to.

This is the syntax error I keep getting...

ubuntu@ip-172-31-16-206:~$ sudo curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
>>> /etc/sudoers: syntax error near line 9 <<<
>>> /etc/sudoers: syntax error near line 9 <<<
sudo: parse error in /etc/sudoers near line 9
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
sudo: parse error in /etc/sudoers near line 9
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

I would truly appreciate any help.

Abdulaziz Jama avatar
us flag
@matigo Yes I did that and I keep getting the syntax error unfortunately.
in flag
If every attempt to use `sudo` results in an error, then something has been messed up pretty seriously in one of the configuration files. As this is an EC2 instance, you may want to spin up a new one and replace the existing server
Abdulaziz Jama avatar
us flag
Yes just simply entering sudo results in that syntax error popping up. I'll try launching a new EC2 instance. @matigo
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.