npm seems to use different git setup

Created on 18 Nov 2017  Â·  5Comments  Â·  Source: sindresorhus/np

Issuehunt badges

I am running git version 2.15.0.windows.1.

I get following output:

 √ Running tests
 × Bumping version using npm
   → v2.0.0
   Publishing package
   Pushing tags

× Command failed: npm version 2.0.0
npm ERR! code 128
npm ERR! Command failed: git -c core.longpaths=true commit -m 2.0.0
npm ERR!
npm ERR! *** Please tell me who you are.
npm ERR!
npm ERR! Run
npm ERR!
npm ERR!   git config --global user.email "[email protected]"
npm ERR!   git config --global user.name "Your Name"
npm ERR!
npm ERR! to set your account's default identity.
npm ERR! Omit --global to set the identity only in this repository.
npm ERR!
npm ERR! fatal: unable to auto-detect email address (got 'Oliver@Llardana.(none)')
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Oliver\AppData\Roaming\npm-cache\_logs\2017-11-18T00_10_34_686Z-debug.log
v2.0.0

9 info git [ 'add', 'D:\\git-repositories\\ADs\\adr-log\\package.json' ]
10 info git [ 'add',
10 info git   'D:\\git-repositories\\ADs\\adr-log\\package-lock.json' ]
11 info git [ 'commit', '-m', '2.0.0' ]
12 verbose stack Error: Command failed: git -c core.longpaths=true commit -m 2.0.0
12 verbose stack
12 verbose stack *** Please tell me who you are.
12 verbose stack
12 verbose stack Run
12 verbose stack
12 verbose stack   git config --global user.email "[email protected]"
12 verbose stack   git config --global user.name "Your Name"
12 verbose stack
12 verbose stack to set your account's default identity.
12 verbose stack Omit --global to set the identity only in this repository.
12 verbose stack
12 verbose stack fatal: unable to auto-detect email address (got 'Oliver@Llardana.(none)')
12 verbose stack
12 verbose stack     at ChildProcess.exithandler (child_process.js:275:12)
12 verbose stack     at emitTwo (events.js:126:13)
12 verbose stack     at ChildProcess.emit (events.js:214:7)
12 verbose stack     at maybeClose (internal/child_process.js:925:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
13 verbose cwd D:\git-repositories\ADs\adr-log
14 verbose Windows_NT 10.0.16299
15 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Oliver\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "version" "2.0.0"
16 verbose node v8.9.1
17 verbose npm  v5.5.1
18 error code 128
19 error Command failed: git -c core.longpaths=true commit -m 2.0.0
19 error
19 error *** Please tell me who you are.
19 error
19 error Run
19 error
19 error   git config --global user.email "[email protected]"
19 error   git config --global user.name "Your Name"
19 error
19 error to set your account's default identity.
19 error Omit --global to set the identity only in this repository.
19 error
19 error fatal: unable to auto-detect email address (got 'Oliver@Llardana.(none)')
20 verbose exit [ 1, true ]

However, my configuration seems to be correct:

$ git config -l | grep -i user
user.name=Oliver Kopp
[email protected]

There is a $40.00 open bounty on this issue. Add more on Issuehunt.

Funded on Issuehunt bug

Most helpful comment

+1, if this happens on Windows: try setting C:\Users\<username>\.gitconfig

All 5 comments

I am seeing this same behavior. It's making a CI tool around my npm packages a pain in the ass as they can't increment the version number using the CI tools semversioning

I infer you're using windows, and so am I.

Although I never had this issue but maybe try removing stock git cli (the one from git-scm) and instead installing Github desktop application (which of course will also install git cli).

Maybe Github desktop app does things (credential management) differently than stock git.

Also check what this returns

$ npm config get git
> npm config get git
git

As workaround, I am currently using release-it, which does not have the strong checks as np does, but works perfectly with GitHub.

+1, if this happens on Windows: try setting C:\Users\<username>\.gitconfig

@issuehunt has funded $40.00 to this issue.


Was this page helpful?
0 / 5 - 0 ratings

Related issues

sindresorhus picture sindresorhus  Â·  7Comments

doug-wade picture doug-wade  Â·  5Comments

bennycode picture bennycode  Â·  4Comments

sindresorhus picture sindresorhus  Â·  4Comments

artivilla picture artivilla  Â·  5Comments