Npm-check-updates: 8.x Crashes on `git+https` path

Created on 2 Sep 2020  路  7Comments  路  Source: raineorshine/npm-check-updates

  • [x] I have searched for similar issues
  • [x] I am using the latest version of npm-check-updates
  • [x] I am using node >= 10.17 (using 12.18.0)

Steps to Reproduce

  1. Use Windows (git bash 2.28.0) -- not sure if Windows-specific though
  2. Put in your package.json an entry like this:
"pkgname": "git+https://abc123:[email protected]/organization/reponame.git#v0.4.2"
  1. npm install -g [email protected]
  2. ncu --semverLevel major

Current Behavior

Crashes with an error, and doesn't output anything for non-git paths.

Error: Command failed: git ls-remote --tags git+https://github.com/organization/reponame.git
git: 'remote-git+https' is not a git command. See 'git --help'.

    at ChildProcess.exithandler (child_process.js:303:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
  killed: false,
  code: 128,
  signal: null,
  cmd: 'git ls-remote --tags git+https://github.com/organization/reponame.git',
  stdout: '',
  stderr: "git: 'remote-git+https' is not a git command. See 'git --help'.\n"
}

Expected Behavior

Should gracefully skip the problematic dependency, ideally doing something sensible

Possible cause

Looks linked to #716 - maybe special case on Windows (or something else) that is not taken into account.

bug

Most helpful comment

Should be fixed in 4fcfcd0.

Please try v8.0.5

All 7 comments

The same issue. I have reverted ncu to 7.x

Thanks for reporting!

Try v8.0.4

Related: #727

@raineorshine I am running v8.0.4 but I'm still getting an error when running ncu -u... because of an entry in my package.json of the form:

"dependencies": {
    "common": "git+https://username:[email protected]/somename/common.git#v283",
}

Error is:

Upgrading /root/workspace/myapp/package.json
[===================-] 26/27 96%/usr/lib/node_modules/npm-check-updates/lib/npm-check-updates.js:348
  throw err
  ^

TypeError: Invalid Version: v283
    at new SemVer (/usr/lib/node_modules/npm-check-updates/node_modules/semver/classes/semver.js:41:13)
    at outside (/usr/lib/node_modules/npm-check-updates/node_modules/semver/ranges/outside.js:12:13)
    at Object.ltr (/usr/lib/node_modules/npm-check-updates/node_modules/semver/ranges/ltr.js:3:42)
    at isUpgradeable (/usr/lib/node_modules/npm-check-updates/lib/versionmanager.js:211:17)
    at /usr/lib/node_modules/npm-check-updates/lib/versionmanager.js:160:67
    at /usr/lib/node_modules/npm-check-updates/node_modules/lodash/lodash.js:13616:16
    at basePickBy (/usr/lib/node_modules/npm-check-updates/node_modules/lodash/lodash.js:3783:13)
    at Function.pickBy (/usr/lib/node_modules/npm-check-updates/node_modules/lodash/lodash.js:13615:14)
    at /usr/lib/node_modules/npm-check-updates/node_modules/lodash/lodash.js:4388:28
    at arrayReduce (/usr/lib/node_modules/npm-check-updates/node_modules/lodash/lodash.js:683:21)

Never got such an error before upgrading to version 8.

Indeed you are correct! Let me look into it.

Should be fixed in 4fcfcd0.

Please try v8.0.5

A published fix within around 15 mins... very impressive! Yes, I can confirm that an error is no longer thrown. Thanks!

Confirming the bug is fixed. That was fast! 馃憣

Was this page helpful?
0 / 5 - 0 ratings

Related issues

frankTadlip picture frankTadlip  路  4Comments

anonimoconiglio picture anonimoconiglio  路  6Comments

nicksarafa picture nicksarafa  路  6Comments

dereklin picture dereklin  路  6Comments

eddieedease picture eddieedease  路  4Comments