0

I want to install https://github.com/kangax/html-minifier .

But after using npm install html-minifier I get the message:

bash: npm: command not found

I'm using Debian 9 stretch and got nodejs by apt-get install . I've tryed to fix my problem by installing nodejs-legacy and build-essential but nothing changed. If I use nodejs -v I get v4.8.2. I never used nodejs befor, what do I wrong?

mbergmann
  • 75
  • 1
  • 2
  • 8

1 Answers1

-1

Try installing npm with 'sudo apt-get install npm' and it should work. You could also install node js via nvm (https://github.com/creationix/nvm).

It will automatically install npm for you.

Ankit Bahuguna
  • 568
  • 3
  • 13
  • Running sudo apt-get install npm gets me: `Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package npm` – mbergmann Nov 20 '17 at 11:17
  • Can you try installing via NVM . Run 'curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash' to install nvm. After nvm is installed you can then install node js by running 'nvm install v8.9.1'. After reloading .bashrc, the npm should work. – Ankit Bahuguna Nov 20 '17 at 11:20
  • 1
    Now I have npm installed. I'm very stupid npm doesn't belong to the official debian packes. I installed it with: `curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -` and `sudo apt-get install -y nodejs` – mbergmann Nov 21 '17 at 13:49