0

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'
/usr/src/linux-headers-4.9.0-11-amd64/include/config/have/memblock/node
/usr/src/linux-headers-4.9.0-11-amd64/include/config/use/percpu/numa/node
/usr/src/linux-headers-4.19.0-0.bpo.9-amd64/include/config/have/memblock/node
/usr/src/linux-headers-4.19.0-0.bpo.9-amd64/include/config/use/percpu/numa/node
/usr/src/linux-headers-4.9.0-12-amd64/include/config/have/memblock/node
/usr/src/linux-headers-4.9.0-12-amd64/include/config/use/percpu/numa/node
/sys/devices/system/node
/sys/bus/node
/proc/irq/0/node
/proc/irq/1/node
/proc/irq/2/node
/proc/irq/3/node
/proc/irq/4/node
/proc/irq/5/node
/proc/irq/6/node
/proc/irq/7/node
/proc/irq/8/node
/proc/irq/9/node
/proc/irq/10/node
/proc/irq/11/node
/proc/irq/12/node
/proc/irq/13/node
/proc/irq/14/node
/proc/irq/15/node
/proc/irq/18/node
/proc/irq/20/node
/proc/irq/23/node
/proc/irq/24/node
/proc/irq/25/node
/proc/irq/26/node
/proc/irq/27/node
/proc/irq/28/node
/proc/irq/29/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
v4.8.2

1 Answer 1

2

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.

3
  • /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 .