Installing express with npm: failure #1111

Closed
ajoslin opened this Issue Apr 26, 2012 · 15 comments

4 participants

@ajoslin

I'm on Mac OSX Lion.

Here is the log:

Andy-Joslin:projects atjoslin$ npm install -g express
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/connect
npm http GET https://registry.npmjs.org/mime/1.2.4
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/mkdirp/0.3.0
npm http 304 https://registry.npmjs.org/mkdirp/0.3.0
npm http 304 https://registry.npmjs.org/connect
npm http 304 https://registry.npmjs.org/qs
npm http 304 https://registry.npmjs.org/mime/1.2.4
npm http GET https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/formidable

npm ERR! Error: ENOENT, open '/usr/local/lib/node_modules/express/node_modules/connect/node_modules/formidable/package.json'
npm ERR! You may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>
npm ERR! 
npm ERR! System Darwin 11.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express"
npm ERR! cwd /Users/atjoslin/projects
npm ERR! node -v v0.6.13
npm ERR! npm -v 1.1.9
npm ERR! path /usr/local/lib/node_modules/express/node_modules/connect/node_modules/formidable/package.json
npm ERR! code ENOENT
npm ERR! message ENOENT, open '/usr/local/lib/node_modules/express/node_modules/connect/node_modules/formidable/package.json'
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/atjoslin/projects/npm-debug.log
npm not ok
@yuanchuan

try "sudo npm install -g express"

@ajoslin

Hi yuanchan,

It's still erroring with sudo - the exact same error in fact.

I added my OS (Mac OSX lion) details to the main post, incase it helps.

@tj
expressjs member
tj commented Apr 26, 2012

did you try updating npm

@ajoslin

I still get the same error after npm update.

I do get a different error if I try to install express 3.0 alpha (using npm install -g express@3.0). Here is the log: http://d.pr/n/9cXb

I guess I can give a little more info as to what I did before this stopped working:
1. I had express current version nstalled and working, but then I tried to install express 3.0 alpha with npm install -g express@3.0. That gave me an error.
2. Then I tried to remove existing express with npm uninstall -g express. The uninstall worked fine.

3. Then I tried npm install -g express@3.0, and it still gave me the error above.

4. Then I tried just installing regular express again, and am getting this error.

I've tried all the installs without the -g too, incase my lib folders are messed up somehow. But the errors are the same without the global flag.

Hope that helps.

@tj
expressjs member
tj commented Apr 26, 2012

seems like this is maybe more of an npm thing, can you install -g mocha etc fine? mocha --version

@ajoslin

Yeah, I can install coco, mocha, and coffee-script fine ( a few random libraries I thought of)

@tj
expressjs member
tj commented Apr 26, 2012

hmm i dont know why formidable's package.json wouldn't be present. I just rm -fr node_modules when npm screws up and try again

@tj
expressjs member
tj commented Apr 26, 2012

also remember to do npm install npm etc to update, npm update doesn't update npm itself AFAIK

@ajoslin

I removed npm and all my modules and re-installed it from the .pkg on nodejs.org.

I still get the same error when installing express, but other libraries install fine.

Should I open this issue on the formidable repo?

@tj
expressjs member
tj commented Apr 26, 2012

not sure, i think it's an npm related bug, works 100% fine for me. closing until someone can reproduce

@tj tj closed this Apr 26, 2012
@arbales

This happens to me as well –

• Node v0.6.7 || v0.6.15
• npm 1.1.0-2 || 1.1.18
• "express": "latest"

@arbales

This appears to be either a bug in bsdtar or in the formidable tarball itself.

I was able to install the package by temporarily aliasing tar to gtar

brew install gnu-tar && alias tar=gtar

See also: npm/npm#2360 (comment)
And: npm/npm#1512 (comment)

@ajoslin

Hi arbales, I'm glad it works for you, but for me I still get the same error on installing formidable after doing that:

Andy-Joslin:views atjoslin$ brew list | grep gnu-tar
gnu-tar
Andy-Joslin:views atjoslin$ tar
gtar: You must specify one of the `-Acdtrux' or `--test-label'  options
Try `gtar --help' or `gtar --usage' for more information.
Andy-Joslin:views atjoslin$ sudo npm install -g formidable
npm http GET https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/formidable

npm ERR! Error: ENOENT, open '/usr/local/lib/node_modules/formidable/package.json'
@arbales

perhaps try rm -rf ./node_modules first?

it actually looks like we're experiencing different errors – NPM couldn't unarchive formidable for me.

@ajoslin

I managed to get it working now by installing connect v1.7.4 -- a version that doesn't use formidable, but still satisfies express's depency. Then I installed express, and all worked. So for now, I'm OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment