Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm v5 install crashes on git dependency #16907

Closed
1 of 13 tasks
medikoo opened this issue Jun 2, 2017 · 22 comments
Closed
1 of 13 tasks

npm v5 install crashes on git dependency #16907

medikoo opened this issue Jun 2, 2017 · 22 comments

Comments

@medikoo
Copy link

medikoo commented Jun 2, 2017

Might be related to #16898

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

It crashes on install of dependency formulated as:

 "serverless-meta-sync": "git://github.com/serverless/serverless-meta-sync.git#c5e34a59a8665df703534ee18464d035ef30edc6"

How can the CLI team reproduce the problem?

Create folder with package.json as:

{
  "dependencies": {
    "serverless-meta-sync": "git://github.com/serverless/serverless-meta-sync.git#c5e34a59a8665df703534ee18464d035ef30edc6"
  }
}

Run:

$  npm install

It crashes with:

$ npm install
npm ERR! code 128
npm ERR! Command failed: /usr/local/bin/git clone --depth=1 -q -b 15/head git://github.com/serverless/serverless-meta-sync.git /Users/medikoo/.npm/_cacache/tmp/git-clone-aa8b2c4e
npm ERR! warning: templates not found /var/folders/rr/p8qlym295pv8b2b3bdhz1hwc0000gn/T/pacote-git-template-tmp/git-clone-e912360e
npm ERR! warning: Could not find remote branch 15/head to clone.
npm ERR! fatal: Remote branch 15/head not found in upstream origin
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/medikoo/.npm/_logs/2017-06-02T08_30_33_855Z-debug.log

Content of debug log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install' ]
2 info using npm@5.0.1
3 info using node@v8.0.0
4 silly install runPreinstallTopLevelLifecycles
5 silly preinstall maas-tsp-reference-zip
6 info lifecycle @~preinstall: @
7 silly lifecycle @~preinstall: no script for preinstall, continuing
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 silly install loadAllDepsIntoIdealTree
14 silly fetchPackageMetaData error for serverless-meta-sync@git://github.com/serverless/serverless-meta-sync.git#c5e34a59a8665df703534ee18464d035ef30edc6 Command failed: /usr/local/bin/git clone --depth=1 -q -b 15/head git://github.com/serverless/serverless-meta-sync.git /Users/medikoo/.npm/_cacache/tmp/git-clone-aa8b2c4e
14 silly fetchPackageMetaData warning: templates not found /var/folders/rr/p8qlym295pv8b2b3bdhz1hwc0000gn/T/pacote-git-template-tmp/git-clone-e912360e
14 silly fetchPackageMetaData warning: Could not find remote branch 15/head to clone.
14 silly fetchPackageMetaData fatal: Remote branch 15/head not found in upstream origin
15 verbose stack Error: Command failed: /usr/local/bin/git clone --depth=1 -q -b 15/head git://github.com/serverless/serverless-meta-sync.git /Users/medikoo/.npm/_cacache/tmp/git-clone-aa8b2c4e
15 verbose stack warning: templates not found /var/folders/rr/p8qlym295pv8b2b3bdhz1hwc0000gn/T/pacote-git-template-tmp/git-clone-e912360e
15 verbose stack warning: Could not find remote branch 15/head to clone.
15 verbose stack fatal: Remote branch 15/head not found in upstream origin
15 verbose stack
15 verbose stack     at ChildProcess.exithandler (child_process.js:252:12)
15 verbose stack     at emitTwo (events.js:125:13)
15 verbose stack     at ChildProcess.emit (events.js:213:7)
15 verbose stack     at maybeClose (internal/child_process.js:887:16)
15 verbose stack     at Socket.stream.socket.on (internal/child_process.js:340:11)
15 verbose stack     at emitOne (events.js:115:13)
15 verbose stack     at Socket.emit (events.js:210:7)
15 verbose stack     at Pipe._handle.close [as _onclose] (net.js:546:12)
16 verbose cwd /Users/medikoo/Projects/maas/maas-tsp-reference-zip
17 verbose Darwin 16.6.0
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
19 verbose node v8.0.0
20 verbose npm  v5.0.1
21 error code 128
22 error Command failed: /usr/local/bin/git clone --depth=1 -q -b 15/head git://github.com/serverless/serverless-meta-sync.git /Users/medikoo/.npm/_cacache/tmp/git-clone-aa8b2c4e
22 error warning: templates not found /var/folders/rr/p8qlym295pv8b2b3bdhz1hwc0000gn/T/pacote-git-template-tmp/git-clone-e912360e
22 error warning: Could not find remote branch 15/head to clone.
22 error fatal: Remote branch 15/head not found in upstream origin
23 verbose exit [ 1, true ]

I also tried with fresh setup (removed ~/.npm) same error occurs.

Package installs successfully when I downgrade to npm v4

supporting information:

  • npm -v prints: 5.0.1
  • node -v prints: v8.0.0
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: macOs
  • Network issues:
    • Geographic location where npm was run: Warsaw, Poland
    • I use a proxy to connect to the npm registry.
    • I use a proxy to connect to the web.
    • I use a proxy when downloading Git repos.
    • I access the npm registry via a VPN
    • I don't use a proxy, but have limited or unreliable internet access.
  • Container:
    • I develop using Vagrant on Windows.
    • I develop using Vagrant on OS X or Linux.
    • I develop / deploy using Docker.
    • I deploy to a PaaS (Triton, Heroku).
@mistydemeo
Copy link

This looks like a dupe of #16898.

@npm-robot
Copy link

We're closing this issue as it has gone seven days without activity and without being labeled. If we haven't even labeled in issue in seven days then we're unlikely to ever read it.

If you are still experiencing the issue that led to you opening this or this is a feature request you're still interested in then we encourage you to open a new issue. If this was a support issue, you may be better served by joining package.communty and asking your question there.

For more information about our new issue aging policies and why we've instituted them please see our blog post.

@laurisvan
Copy link

I can confirm this error still repeated on with npm@5.0.4, so we should reopen it.

@medikoo
Copy link
Author

medikoo commented Jul 3, 2017

@iarna @zkat will you reopen, or should I report it again?

@medikoo
Copy link
Author

medikoo commented Jul 6, 2017

I can confirm it's still a bug with npm@5.1.0

@jehy
Copy link

jehy commented Jul 10, 2017

Yup, bug still exists in npm 5.1.0

@israel-maloney
Copy link

I experienced this issue on version 5.0.3, then regressed to version 4.2.0 to get around the issue for now.

@medikoo
Copy link
Author

medikoo commented Jul 11, 2017

@zkat @iarna are you considering reopenning the issue? It's clearly a critical bug with npm@5

@medikoo medikoo changed the title npm v5.0.1 install crashes on git dependency npm v5 install crashes on git dependency Sep 7, 2017
@jcroll
Copy link

jcroll commented Sep 15, 2017

Please reopen issue, it's a bug!

@ljharb
Copy link
Contributor

ljharb commented Sep 15, 2017

File a new one then :-)

@jcroll
Copy link

jcroll commented Sep 15, 2017

:-) why

@ljharb
Copy link
Contributor

ljharb commented Sep 15, 2017

I would assume because you want it fixed?

@jcroll
Copy link

jcroll commented Sep 15, 2017

To the same efficiency the opener of this thread experienced?

@medikoo
Copy link
Author

medikoo commented Sep 18, 2017

There were other issue attempts:

#16991 (comment)
#18056

No success, it appears it's the way things are handled here

@kontrollanten
Copy link

I solved it by updating to version 5.7.1 by running

npm install npm -g

@mfpiccolo
Copy link

mfpiccolo commented Apr 5, 2018

This is still a bug on 5.8.0

@zkat
Copy link
Contributor

zkat commented Apr 5, 2018

Alright so, I need a better repo: @medikoo's repro works now, but that's because c5e34a59a8665df70 literally does not exist when you clone that repo. I see that serverless/serverless-meta-sync@c5e34a5 exists on github, but if I clone that repo manually, that shasum is not there. So I'm not sure what's going on here.

This issue is closed because the original issue, where a remote branch was being referenced, is no longer a problem and was fixed a while back. To y'all replying: it's way more helpful to have a full, self-contained reproduction for a bug, and hopefully after you've done your own debugging on the git repo with the commands stated. Otherwise, it's extraordinarily useless to keep posting in a closed issue thread like this.

@medikoo
Copy link
Author

medikoo commented Apr 6, 2018

@zkat see: serverless/serverless-meta-sync#15

It looks it was a desired change that was proposed as PR, but not merged as it didn't apply to shortly coming SLS v1 version.

For those stuck at SLS v0.5 it was recommended to rely on serverless/serverless-meta-sync.git#c5e34a59a8665df703534ee18464d035ef30edc6 in package.json.

So technically this commit never landed in serverless/serverless-meta-sync repo, but referring to that commit (in context of serverless/serverless-meta-sync) works both on Github, and installs without issues with npm v4, and why is that, I'm also unable to explain.

@zkat
Copy link
Contributor

zkat commented Apr 6, 2018

@medikoo I literally don't understand how it works on npm@4. I am -tremendously- confused about this because raw git itself can't clone this. If anyone figures out how the hell this is happening, I will happily fix it. I'm vexed.

@zkat
Copy link
Contributor

zkat commented Apr 6, 2018

oh nevermind I figured it out. lol

zkat added a commit to zkat/pacote that referenced this issue Apr 6, 2018
@zkat
Copy link
Contributor

zkat commented Apr 6, 2018

zkat/pacote@fb186f9

It'll work with this patch. Just gonna do some routine checks and it should go out with the next possible release.

zkat added a commit to zkat/pacote that referenced this issue Apr 6, 2018
@medikoo
Copy link
Author

medikoo commented Apr 9, 2018

Just gonna do some routine checks and it should go out with the next possible release.

Thank you!

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