JamieMason / shrinkpack

Fast, resilient, reproducible builds with npm install.
https://www.npmjs.com/package/shrinkpack
MIT License
793 stars 38 forks source link

NPM5 – npm ERR! aggregate error #87

Closed JamieMason closed 7 years ago

JamieMason commented 7 years ago

This affects the npm5 development work, not production shrinkpack.

Clone the dev branch and run shrinkpack on itself.

git clone https://github.com/JamieMason/shrinkpack.git -b dev
npm install
npm run build
NODE_ENV=development node dist/bin.js --compress

npm install will work but rm -rf node_modules and try npm install again and you will receive the following error

npm ERR! aggregate error

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/you/.npm/_logs/2017-08-09T14_48_49_245Z-debug.log

The shrinkpacked package-lock.json and 2017-08-09T14_48_49_245Z-debug.log is attached.

Useful resources;

The source for the new shrinkpack can be found at https://github.com/JamieMason/shrinkpack/blob/dev/src/index.js.

JamieMason commented 7 years ago

@zkat @iarna would you have any information please on aggregate errors? I've searched "aggregate" in the npm repo but don't find any matches. Any pointers would be a huge help, thanks a lot.

EDIT: I've seen that aggregate errors actually originate from bluebird. Seeing what else I can find further up the stack trace.

iarna commented 7 years ago

huh, no, I've not seen those before… can you run again with BLUEBIRD_DEBUG=1 set?

(It'll give a much better stack trace in the debug log.)

iarna commented 7 years ago

Looks like it's an array of errors from a call to .some(), when ALL of the promises reject: http://bluebirdjs.com/docs/api/promise.some.html

BLUEBIRD_DEBUG will hopefully show us which .some() in the npm code base is doing this.

JamieMason commented 7 years ago

To save wasting your time I think this can be closed for now @iarna. I've not been able to reproduce it since and I think the cause will likely be an incorrect package-lock.json produced by shrinkpack. If I see it again I will reopen and add steps to reproduce.

JamieMason commented 7 years ago

Hi @iarna, I've been able to reproduce this again and have created a new branch at https://github.com/JamieMason/shrinkpack/tree/aggregate-error which should have everything needed to reproduce it, plus the full error logs.

I will take a look at the lines in the stack trace and post anything I find here, thanks.

JamieMason commented 7 years ago

Closing as duplicate of #83