4

I am having this error with node. Running Debian 7 (Wheezy) a VPS.

I have this error if I for example run this command (in the directory of the .js)

node sell.js

or

screen node sell.js

They both don't work, because I am getting this error:

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

Can somebody help me?

S.I.
  • 3,250
  • 12
  • 48
  • 77
  • Does it get fixed if you say `sudo apt-get install nodejs-legacy`? (from a [github issue](https://github.com/nodejs/node-v0.x-archive/issues/3911#issuecomment-18951288)) – fedorqui May 27 '16 at 10:44
  • What does this have to do with php? – Epodax May 27 '16 at 10:50
  • @Epodax I am sorry wrong tag :/ – Justin van Dongen May 27 '16 at 11:57
  • Before you operate a machine connected to the Internet please learn the basics of the operating system. A badly maintained machine easily becomes hacked and then serves as spamboot, ddos bot or in some other bad way hurting others. – johannes May 27 '16 at 12:25

4 Answers4

13

As in @Quentin's answer, the name of the executable may be incorrect. In many cases, what got installed was nodejs, not node. The line below creates a symbolic link that points to nodejs from where your system looks when you type node. It is a work-around - an alternative to simply typing nodejs

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

MANA624
  • 986
  • 4
  • 10
  • 34
Elmiya Agnes
  • 243
  • 2
  • 11
2

The Debian package for NodeJS is called nodejs and installed the executable /usr/bin/nodejs.

node is the wrong program, it is for ham radio operations, and your install of it appears to be broken anyway).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
2

I ran the command:

sudo apt-get install nodejs-legacy

and nodejs worked again!

fedorqui
  • 275,237
  • 103
  • 548
  • 598
0

Maybe something wrong happened during your node's installing.

And system environment variable shows the command "node" referes to /usr/sbin/node .

Try download node linux binaries from official. Rename and put it in /usr/sbin after extracting the source. Of course you can put it in another folder as long as you update the system environment variables.

zcmyworld
  • 393
  • 1
  • 2
  • 9