Use this:
curl -k https://npmjs.org/install.sh | sudo sh
Note: npm included in new versions of node.js. No need to install it separately now.
Try:
curl -O https://www.npmjs.org/install.shsudo sh install.sh
Inspired by this.