I did on Debian testing sudo apt install nodejs but I'm missing npm.

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

What did I miss?


2 Answers 2


npm turned out to involve too much work to maintain properly (with security support etc.) in Debian 9, given the current level of maintainer involvement, so it was removed from the release and isn’t available from the “stable” Debian repositories.

To install NPM you should follow the upstream instructions, which will configure your system to use their repository:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

This will install Node.js 8.x; if you need 10.x you can replace the “8” above with “10”.

  • pnpm sound actually good ` curl -L unpkg.com/@pnpm/self-installer | sudo node` May 23, 2018 at 6:04
  • 1
    hm, this will still install the -dfsg debian version without npm :-(
    – dothebart
    Aug 24, 2018 at 12:15
  • 1
    @dothebart I just checked, and on a default Debian setup, the instructions above install the Node.js-hosted version with npm (apt policy shows it as the candidate version). You might want to ask a new question explaining your problem: describe the steps you followed to try to install nodejs, and most importantly, include the output of apt policy nodejs. Aug 24, 2018 at 12:31
  • my problem was that the script will terminate if there are apt-errors from other repos, and thus the nodesource repo wasn't added in first place.
    – dothebart
    Aug 27, 2018 at 11:25

To Install NodeJS execute following three steps

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install nodejs npm
sudo ln -s /usr/bin/nodejs /usr/bin/node

You must log in to answer this question.

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