I want to install npm and node.

sudo apt-get install -y npm nodejs

It encounter some warning:

Unable to correct problems, you have held broken packages

Now try hard to fix the dependencies of broken packages with argument -f.

sudo aptitude -f install  npm  nodejs

No node command can called:

node -v
bash: node: command not found
npm -v
bash: npm: command not found

Try to find the node's location.

sudo find /  -name  'node'

Search npm:

sudo find  /  -name  'npm'
#nothing searched

How to call node and npm in my os?

Thank to @Freddy,it located in /usr/bin/nodejs.

nodejs -v

1 Answer 1


According to your existing kernel version you're probably running Debian stretch and the node binary should be installed to /usr/bin/nodejs (see the filelist).

In newer Debian releases the binary is installed to /usr/bin/node and an additional symlink /usr/bin/nodejs points to the node binary.

  • /usr/bin/nodejs -v v4.8.2
    – showkey
    Jul 12, 2020 at 0:25
  • And how to call npm then?
    – showkey
    Jul 12, 2020 at 0:29
  • If you have the backports version installed, it's /usr/bin/npm, so npm should work.
    – Freddy
    Jul 12, 2020 at 0:35

You must log in to answer this question.

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