npm version fails to make commit with 6.4.0

cli
priority:high
triaged

(Darryl Pogue) #1

What I Wanted to Do

I run npm version patch to bump the version and make a release commit/tag in git.

What Happened Instead

npm ERR! code 1
npm ERR! Command failed: git commit -S -m 1.0.7
npm ERR! error: pathspec '1.0.7' did not match any file(s) known to git.
npm ERR! 

Reproduction Steps

This seems to happen every time that I run npm version ... with newer (>= 6.4.0?) versions of npm.

Details

I suspect the issue is the lack of quotation marks around the version number/commit message when trying to run git commit -m

Log output
14 info git [ 'add',
14 info git   '/Users/dpogue/Coding/Ayogo/ay-menu-button/package.json' ]
15 info git [ 'add',
15 info git   '/Users/dpogue/Coding/Ayogo/ay-menu-button/package-lock.json' ]
16 info git [ 'commit', '-S -m', '1.0.7' ]
17 verbose stack Error: Command failed: git commit -S -m 1.0.7
17 verbose stack error: pathspec '1.0.7' did not match any file(s) known to git.
17 verbose stack
17 verbose stack     at ChildProcess.exithandler (child_process.js:289:12)
17 verbose stack     at ChildProcess.emit (events.js:182:13)
17 verbose stack     at maybeClose (internal/child_process.js:961:16)
17 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:250:5)
18 verbose cwd /Users/dpogue/Coding/Ayogo/ay-menu-button
19 verbose Darwin 17.7.0
20 verbose argv "/usr/local/Cellar/node/10.9.0/bin/node" "/usr/local/bin/npm" "version" "patch"
21 verbose node v10.9.0
22 verbose npm  v6.4.0
23 error code 1
24 error Command failed: git commit -S -m 1.0.7
24 error error: pathspec '1.0.7' did not match any file(s) known to git.
25 verbose exit [ 1, true ]

Platform Info

$ npm --versions
{ 'ay-menu-button': '1.0.7',
  npm: '6.4.0',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.32.0',
  node: '10.9.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.22.0',
  v8: '6.8.275.24-node.14',
  zlib: '1.2.11' }
$ node -p process.platform
darwin

(Kat Marchán) #2

This is strange. What happens if you run git commit -S -m 1.0.7 manually? 'Cause that definitely works for me. Does it work for you if you do npm config set sign-git-commit false?


(Darryl Pogue) #3

What happens if you run git commit -S -m 1.0.7 manually?

You’re right, this works fine.
I’ll try disabling the sign-git-commit option when I tag something next


(Kat Marchán) #4

ugh, nevermind, I see the bug now. Fix forthcoming…


(Kat Marchán) #5

Here’s a PR that fixes it. Sorry about that!


(system) #6

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