6

I'm trying to get nodejs working. However, it tells me that node is not in my bin even though I downloaded the binary and added the location to my path.

> echo $PATH ...:/home/jvdh/node-v8.11.2-linux-x64/bin

>sudo npm install -g bitcore
/usr/bin/env: ‘node’: No such file or directory

  • did you try without sudo? – Suraj Rao Jun 8 '18 at 6:37
  • that works better but then I get this: npm ERR! Please try running this command again as root/Administrator. – jvdh Jun 8 '18 at 6:50
  • ok.. One question. where (which file) did you set this in path variable? – Suraj Rao Jun 8 '18 at 6:55
  • $HOME/node-v8.11.2-linux-x64/bin – jvdh Jun 8 '18 at 7:03
  • 1
    askubuntu.com/a/161930/401032 – Suraj Rao Jun 8 '18 at 7:04
6

Install nodejs8

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

Install nodejs10

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

Then try again with node

| improve this answer | |
4

Usually this is a simple naming problem, when you install from a package manager your bin file may be called nodejs so you just need to symlink it using the command:

ln -s /usr/bin/nodejs /usr/bin/node

| improve this answer | |
0

For Ubuntu 20.04, you can install node.js and npm:

sudo apt install nodejs npm
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.