Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] SyntaxError: Parsing JSON at <path> for commitizen config failed:

See original GitHub issue

Issue Description

1. Summary

I can’t begin to use commitizen globally in my Windows.

2. Environment

  • Windows 10 Enterprise LTSB 64-bit EN,
  • Node.js 9.4.0,
  • npm 5.6.0.

3. Steps to reproduce

D:\SashaBranchReleaseIt>npm install -g commitizen
C:\Users\SashaChernykh\AppData\Roaming\npm\git-cz -> C:\Users\SashaChernykh\AppData\Roaming\npm\node_modules\commitizen\bin\git-cz
C:\Users\SashaChernykh\AppData\Roaming\npm\commitizen -> C:\Users\SashaChernykh\AppData\Roaming\npm\node_modules\commitizen\bin\commitizen
+ commitizen@2.9.6
updated 1 package in 8.143s

D:\SashaBranchReleaseIt>npm install -g cz-conventional-changelog
+ cz-conventional-changelog@2.1.0
updated 1 package in 1.217s

D:\SashaBranchReleaseIt>echo %HOME%

I create a file .czrc in C:\Users\SashaChernykh directory. It content:

echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc

I run git cz command in any my git repository.

4. Expected behavior

Successful usage commitizen.

5. Actual behavior

D:\SashaBranchReleaseIt>git cz
    throw error;

SyntaxError: Parsing JSON at C:\Users\SashaChernykh\.czrc for commitizen config failed:

    at JSON.parse (<anonymous>)
    at C:\Users\SashaChernykh\AppData\Roaming\npm\node_modules\commitizen\dist\configLoader\getContent.js:40:17
    at readConfigContent (C:\Users\SashaChernykh\AppData\Roaming\npm\node_modules\commitizen\dist\configLoader\getContent.js:46:18)
    at getConfigContent (C:\Users\SashaChernykh\AppData\Roaming\npm\node_modules\commitizen\dist\configLoader\getContent.js:78:17)
    at loader (C:\Users\SashaChernykh\AppData\Roaming\npm\node_modules\commitizen\dist\configLoader\loader.js:62:56)
    at Object.load (C:\Users\SashaChernykh\AppData\Roaming\npm\node_modules\commitizen\dist\commitizen\configLoader.js:17:35)
    at Object.bootstrap (C:\Users\SashaChernykh\AppData\Roaming\npm\node_modules\commitizen\dist\cli\git-cz.js:26:70)
    at Object.<anonymous> (C:\Users\SashaChernykh\AppData\Roaming\npm\node_modules\commitizen\bin\git-cz.js:2:34)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)


Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

Kristinitacommented, Jan 24, 2018

I’m sorry, stupid error.

Valid .czrc content is:

{ "path": "cz-conventional-changelog" }


hxzhao527commented, Mar 12, 2018

What is the difference?

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm "failed to parse json" - Stack Overflow
Mostly, this error is due to a syntax error in package.json file. In my case, the opening curly brace for dependencies object in...
Read more >
Error Failed to parse json-This is not a bug in npm - Edureka
When I'm trying to install express with npm I always get the following error: Failed to parse json No data, empty input at...
Read more >
eslint: failed to load config next/babel to extend from. - ...
I was missing the package @vue/prettier/@typescript-eslint, after installing the package version matching my package.json, I was good. Hope that helps someone.
Read more >
保守性の高いコミットメッセージを書こう - Zenn
[Question] SyntaxError: Parsing JSON at <path> for commitizen config failed: に対するエラーは以下のissueで議論されていました。
Read more >
The 10 tools I wish I knew when I started working with Python
Learn about how venvs, flake8, black, isort, pytest, commitizen, ... 12 min read ... then add the snippet below to your .vscode/settings.json
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found