Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Crashes if run without cache option #141

Open
Lambdac0re opened this issue Feb 26, 2018 · 4 comments
Open

Crashes if run without cache option #141

Lambdac0re opened this issue Feb 26, 2018 · 4 comments

Comments

@Lambdac0re
Copy link

I'm running the following code and it crashes at lib\fetchers\git.js:59 because cacheStream is undefined

require('pacote').manifest('git+http://local-git:7990/server.git#semver:^2.0.0').then(wow => {
  log(wow)
})
@Lambdac0re
Copy link
Author

Unhandled rejection TypeError: Cannot read property 'pipe' of undefined
    at Object.fromManifest (C:\js\generator\node_modules\pacote\lib\fetchers\git.js:59:17)
    at Object.Fetcher#fromManifest [as fromManifest] (C:\js\generator\node_modules\genfun\lib\genfun.js:15:38)
    at fromManifest (C:\js\generator\node_modules\pacote\lib\fetch.js:26:32)
    at tarballedProps (C:\js\generator\node_modules\pacote\lib\finalize-manifest.js:150:23)
    at cachedManifest.then.cached (C:\js\generator\node_modules\pacote\lib\finalize-manifest.js:48:14)
    at tryCatcher (C:\js\generator\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\js\generator\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\js\generator\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromiseCtx (C:\js\generator\node_modules\bluebird\js\release\promise.js:606:10)
    at Async._drainQueue (C:\js\generator\node_modules\bluebird\js\release\async.js:138:12)
    at Async._drainQueues (C:\js\generator\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\js\generator\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

@zkat
Copy link
Owner

zkat commented Mar 15, 2018

Yeah. I've known about this for a while -- it only affects git deps and pacote doesn't run without a cache in the real-world application uses I tend to use it for, so it was kinda low priority. I also wanted to make some architectural changes to how git deps were handled before fixing this bit.

If anyone's interested in picking this fix up, it's fairly well isolated and largely just needs some work done in the git fetcher.

@andreineculau
Copy link
Contributor

andreineculau commented Mar 15, 2018

Could you give some indications as to what you would like to happen? Beyond just fixing it?
If you have a background of why this is happening that's an added bonus. Like i said i don't even know why you need to use end-of-stream for this specific situation (afaics it doesn't need the extra handling beyond the naïve onclose handler to promise)

EDIT: My apologies. Please ignore, I have mistakenly thought that this is a comment for the newly opened issue 143 (by me)

@Lambdac0re
Copy link
Author

I'm trying to check for newer versions from git so i do not need pacote to checkout the repo anyway

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants