Fails on windows: error: unknown switch `m'
See original GitHub issueWhen I run on windows (cygwin shell, cmd and a few types of other shells), the release fails due to an unknown switch being passed to git add.
After a short skimp through the source, I suspect the problem lies in the fact that both git add and git commit are executed at the same time and the ‘;’ separator does not work in the windows cmd, thus the git commit -m flag being passed to add. In true windows style the exec calls cmd regardless of whether I execute standard-release in bash or cmd… Output and debug log below.
My current workaround is to just add and commit myself.
Output
$ npm run release
<redacted>@1.0.0 release <redacted> standard-version
√ bumping version in package.json from 1.0.0 to 1.1.0 √ outputting changes to CHANGELOG.md √ committing package.json and CHANGELOG.md error: unknown switch `m’ usage: git add [options] [–] <pathspec>…
-n, --dry-run dry run
-v, --verbose be verbose
-i, --interactive interactive picking
-p, --patch select hunks interactively
-e, --edit edit current diff and apply
-f, --force allow adding otherwise ignored files
-u, --update update tracked files
-N, --intent-to-add record only the fact that the path will be added later
-A, --all add changes from all tracked and untracked files
--ignore-removal ignore paths removed in the working tree (same as --no-all)
--refresh don't add, only refresh the index
--ignore-errors just skip files which cannot be added because of errors
--ignore-missing check if - even missing - files are ignored in dry run
npm ERR! Windows_NT 6.1.7601
npm ERR! argv “C:\Program Files (x86)\nodejs\node.exe” “C:\Users\Tapppi\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js” “run” “release”
npm ERR! node v4.4.3
npm ERR! npm v3.9.5
npm ERR! code ELIFECYCLE
npm ERR! <redacted>@1.0.0 release: standard-version
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <redacted>@1.0.0 release script ‘standard-version’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the <redacted> package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! standard-version
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs <redacted>
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls <redacted>
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! <redacted>\npm-debug.log
debug-log
0 info it worked if it ends with ok
1 verbose cli [ ‘C:\Program Files (x86)\nodejs\node.exe’,
1 verbose cli ‘C:\Users\Tapppi\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js’,
1 verbose cli ‘run’,
1 verbose cli ‘release’ ]
2 info using npm@3.9.5
3 info using node@v4.4.3
4 verbose run-script [ ‘prerelease’, ‘release’, ‘postrelease’ ]
5 info lifecycle <redacted>@1.1.0~prerelease: <redacted>@1.1.0
6 silly lifecycle <redacted>@1.1.0~prerelease: no script for prerelease, continuing
7 info lifecycle <redacted>@1.1.0~release: <redacted>@1.1.0
8 verbose lifecycle <redacted>@1.1.0~release: unsafe-perm in lifecycle true
9 verbose lifecycle <redacted>@1.1.0~release: PATH: <redacted>
10 verbose lifecycle <redacted>@1.1.0~release: CWD: C:\dev<redacted>
11 silly lifecycle <redacted>@1.1.0~release: Args: [ ‘/d /s /c’, ‘standard-version’ ]
12 silly lifecycle <redacted>@1.1.0~release: Returned: code: 1 signal: null
13 info lifecycle <redacted>@1.1.0~release: Failed to exec release script
14 verbose stack Error: <redacted>@1.1.0 release: standard-version
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Users\Tapppi\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:245:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Users\Tapppi\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:827:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid <redacted>@1.1.0
16 verbose cwd C:\dev<redacted>
17 error Windows_NT 6.1.7601
18 error argv “C:\Program Files (x86)\nodejs\node.exe” “C:\Users\Tapppi\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js” “run” “release”
19 error node v4.4.3
20 error npm v3.9.5
21 error code ELIFECYCLE
22 error <redacted>@1.1.0 release: standard-version
22 error Exit status 1
23 error Failed at the <redacted>@1.1.0 release script ‘standard-version’.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the <redacted> package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error standard-version
23 error You can get information on how to open an issue for this project with:
23 error npm bugs <redacted>
23 error Or if that isn’t available, you can get their info via:
23 error npm owner ls <redacted>
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Sorry about the silly redactions, just playing on the safe side with company stuff 😃
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (7 by maintainers)
Top GitHub Comments
standard-version@2.3.1
has been promoted tolatest
@patrickmichalina Whoops, you’re right, we did not publish a new release since #55 was merged. I will fix this shortly and let you know.