10

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

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

3 Answers 3

8

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

1
7

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

3
1

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

sudo apt install nodejs npm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .