npm i gets unhandled error from ssh dependency with nonexistent tag

What I Wanted to Do

I ran npm install. One of the dev dependencies is coming from github, and referencing a tag. After getting the error, I realized the problem is that the tag doesn’t exist, but the error should have been clearer about which package was problematic and what exactly the problem was (ie, package name, and tag missing).

What Happened Instead

npm gave me an error and told me to report the bug!

Reproduction Steps

  • add a devDependency to a github package pointing to a non existent tag - similar to:
    git+ssh://git@bitbucket.org/org/package.git#2.2
  • run npm i

Details

Here is the cli error

Unhandled rejection Error: Command failed: C:\Program Files\Git\mingw64\bin\git.EXE checkout 2.11sers\...\Documents\Dev\...\node_modules\.staging\babel-runtime-0a
error: pathspec '2.11' did not match any file(s) known to git.

    at ChildProcess.exithandler (child_process.js:289:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
From previous event:
    at promiseRetry (C:\Users\....\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\util\git.js:190:14)
    at C:\Users\...\AppData\Roaming\npm\node_modules\npm\node_modules\promise-retry\index.js:29:24

Platform Info

$ npm --versions
npm: '6.4.1',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.14.1',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.36',
  zlib: '1.2.11' 
$ node -p process.platform
win32

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.