user3752276
user3752276

Reputation: 231

node no such file or directory

I have installed Nodejs in Ubuntu 12 from source ( ./configure && make && sudo make install ) and all done successfully.

when i run

which node

/usr/local/bin/node

But when i run

node server.js

i got:

-bash: /usr/sbin/node: No such file or directory

I echo my path:

echo $PATH
/root/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/mysql/server-5.6/bin

/usr/local/bin is in the PATH.

I found Node.js not found. the same question. but i can not make it work by "sudo ln -s /usr/sbin/node /usr/local/bin/node" because "ln: failed to create symbolic link `/usr/local/bin/node': File exists"

Upvotes: 1

Views: 7527

Answers (2)

Pavel Vlasov
Pavel Vlasov

Reputation: 4331

I've checked it works at Ubuntu 16.04:

sudo apt-get install nodejs-legacy

Upvotes: 1

sjsieg830
sjsieg830

Reputation: 49

I used the terminal to manually copy node and nodejs from /usr/bin to /usr/sbin.

sudo cp /usr/bin/node /usr/bin/nodejs /usr/sbin/

Mine worked after this.

Upvotes: 4

Related Questions