portlandpython / pdxpython

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Three sightings on the "npm install" step during project initialization

ChrisFreeman opened this issue · comments

After some debug, I resolved the errors seen during project initialization during "npm install" step.

First, Typo in ~/.npmrc file. Not sure when this file was created. For some unknown reason, my .npmrc file had the incorrect registry url:

registry = http://registry.mpmjs.org   (notice  "Mpm" instead of "Npm")

should have been:

registry = http://registry.npmjs.org

Second, Once the .npmrc file was fixed. The npm error was based on not finding a compatible version of grunt. 0.4.4 is not in the available list which topped out at version "0.3.17", throwing the following error:

npm ERR! message No compatible version found: grunt@'>=0.4.4- <0.5.0-'

Unfortunately, from Ubuntu 12.04 to 13.04, an old version (0.6.x) of Node is in the standard repository. This can be fixed by adding an apt-get repo. (reference: http://askubuntu.com/questions/49390/how-do-i-install-the-latest-version-of-node-js)

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Summary, fixing the ~/.npmrc, and adding additional apt-get repo fixed all issues for "npm install" step of installation.

I don't have my environment set up yet to create a pull-request with these changes.

Thanks Chris!

You are correct, the version of Node / NPM in Ubuntu <=13.04 is out of date. Installing from Chris Lea's ppa should do the trick. It may help to purge the outdated packages first.

sudo apt-get purge nodejs npm

Also, the NPM registry should point to the secure protocol https not http.

The current version in the registry should be 0.4.4. See https://www.npmjs.org/package/grunt. You can ask NPM for the current version with:

npm show grunt version

If that returns something different, you may want to check the npm cache.

When in the process would I have created the ~/.npmrc file?

As a node dev, I don't have a ~/.npmrc file. You shouldn't need one and
feel free to delete yours unless you are going to point at a different
repository than the standard one.

-Wraithan

On Tue, Apr 15, 2014 at 10:38 AM, Chris Freeman notifications@github.comwrote:

When in the process would I have created the ~/.npmrc file?


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-40511048
.