Install NPM from Command Line

By  on  

I was trying to update my version of NPM using NPM but long story short, a permissions issue allowed NPM to be removed but not re-installed, and thus I was hosed -- NPM was nowhere to be found on "Walshbook Pro."  Eeeek.  Well, you can install NPM via command line with this command:

curl https://www.npmjs.org/install.sh | sh

Life without NPM is no life worth living at all.  AT ALL!  Keep this handy in case you do something stupid like me!

Recent Features

  • By
    LightFace:  Facebook Lightbox for MooTools

    One of the web components I've always loved has been Facebook's modal dialog.  This "lightbox" isn't like others:  no dark overlay, no obnoxious animating to size, and it doesn't try to do "too much."  With Facebook's dialog in mind, I've created LightFace:  a Facebook lightbox...

  • By
    Vibration API

    Many of the new APIs provided to us by browser vendors are more targeted toward the mobile user than the desktop user.  One of those simple APIs the Vibration API.  The Vibration API allows developers to direct the device, using JavaScript, to vibrate in...

Incredible Demos

  • By
    AJAX Page Loads Using MooTools Fx.Explode

    Note: All credit for Fx.Explode goes to Jan Kassens. One of the awesome pieces of code in MooTools Core Developer Jan Kassens' sandbox is his Fx.Explode functionality. When you click on any of the designated Fx.Explode elements, the elements "explode" off of the...

  • By
    Animated AJAX Record Deletion Using Dojo

    I'm a huge fan of WordPress' method of individual article deletion. You click the delete link, the menu item animates red, and the item disappears. Here's how to achieve that functionality with Dojo JavaScript. The PHP - Content & Header The following snippet goes at the...

Discussion

  1. If you use Debian you can just install it with

    sudo apt-get install npm
    • Installing npm with sudo can later cause problems with permissions for some packages (for me it was yeoman)

  2. If you’ve installed node via Homebrew, there was an issue where you could’t update NPM itself if you installed it via Homebrew Node. This is fixed in latest version Homebrew Node package, so you can delete Node and install it again.

  3. I think using NVM is better than anything else: https://github.com/creationix/nvm

    • If you can trust installing a binary from a website, why can’t you trust running a script?

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!