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
    fetch API

    One of the worst kept secrets about AJAX on the web is that the underlying API for it, XMLHttpRequest, wasn't really made for what we've been using it for.  We've done well to create elegant APIs around XHR but we know we can do better.  Our effort to...

  • By
    CSS Filters

    CSS filter support recently landed within WebKit nightlies. CSS filters provide a method for modifying the rendering of a basic DOM element, image, or video. CSS filters allow for blurring, warping, and modifying the color intensity of elements. Let's have...

Incredible Demos

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!