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.