Search code examples
node.jsnpmlinux-mint

NPM appears to do nothing on Linux Mint 15


searched, and did not see this specific problem.

Trying to get a MEAN stack built on my Linux Mint machine, and bumping into a bit of an unusual issue.

Got MongoDB installed, and finally got it running correctly (none of the instructions ANYWHERE mentioned having to create the /data/db/ directory and set permissions, go figure).... it works now.

Got NodeJS installed, and it appears to work correctly.

I had been told (apparently incorrectly) that NPM installs right alongside Node, with:

sudo apt-get install nodejs

but:

$ npm
bash: /usr/bin/npm: No such file or directory

So I go ahead and install NPM separately.

$ sudo apt-get install npm

Seems to work, so far, no errors, and it looks like it is pulling down the NPM package and installing it...

$ nodejs -v
v0.10.21
$ npm -v
$

?? It simply fails to respond without any error... so I try:

$ npm install grunt -g --save-dev
$

Same completely silent failure... in fact, NOTHING I could do gets a response out of NPM.

Looked all over the web, and saw nothing similar anywhere... found out that NPM holds its cache files in ~/.npm and noticed that this folder didn't exist (kinda like the mongo issue above), so I created it, and set permissions to 7777... still nothing.

Purged and re-installed both node and npm, tried installing them both together and separately (yes, desperation)... still no love.

WTF am I doing wrong?

I would love, eventually, to have a nice development environment setup, hopefully with Cloud9 as a local IDE.... but already pulling my hair out.

=========================================================================================

OK, after a few more headaches, this is up and built now... thank you all.

Would love to mark both as answers, but it won't let me.


Solution

  • I don't believe npm comes with the nodejs installation in the apt repo. Try to install npm separately using the following tutorial http://www.giantflyingsaucer.com/blog/?p=1688 'To install NPM ....'

    ====== Edit ====

    node and npm IS separate. Follow the official wiki and everything should be fine