pacote-old: A promise was created in a handler error

This following error is consistently showing up when my team and I run npm install on one of our projects. It wasn’t happening a couple weeks ago.

(node:58234) Warning: a promise was created in a handler at /Users/miles_johnson/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/tarball.js:39:25 but was not returned from it, see http://goo.gl/rRqMUw
    at ret (eval at makeNodePromisifiedEval (/Users/miles_johnson/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:8:21)

I’m guessing because this line (https://github.com/zkat/pacote/blob/latest/lib/fetchers/registry/tarball.js#L43) is not returning. Seems that was last touched 2 months ago, which sort of aligns with this showing up for us.

Node: 8.9.1 NPM 5.8.0

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 2
  • Comments: 24 (11 by maintainers)

Commits related to this issue

Most upvoted comments

It’ll be done when it’s done

Sorry @zkat , I think I really underrated your valuable work regarding pacote! Since most of the people don’t have any clue what is behind the scenes of npm. Thanks!

cool. In any case, this is fixed in pacote@8.1.1, and will be included with the next npm release (which should be next week, I think).

@fernan256 it’ll be done when it’s done.

When you create a promise in a then you should generally return it because otherwise it is possible it’s not being listened to and can cause an unhandled rejection.

If you explicitly want to opt out of it you have two options

  • explicitly return null
  • turn off warnings

I recommend fixing the core issue (that there is a promise no one is listening to) though 😃