Bug: breaking API change in one of commitlint cli's dependencies: read-pkg
See original GitHub issueI notice that commitlint cli in versions 8.3.0 and onwards, you’re using read-pkg version 5.2.0.
Please be aware that there is a significant API change in that module starting at version 4.0.0. The read-pkg API was changed to accept an options objection where one of it’s keys, cwd
, specifies the directory of the package.json to read. If not specified, it will default to the current directory that commitlint is run from. This is buggy since I believe you actually want to read the package.json where commitlint is installed.
Expected Behavior
commitlint >= 8.3.0 reads package.json from install area
Current Behavior
commitlint >= 8.3.0 reads package.json from current workding directory:
cd $HOME
[hvo@hvo-mac ~]$ npx commitlint
/Users/hvo/.nvm/versions/node/v10.18.0/lib/node_modules/commitlint/node_modules/@commitlint/cli
ENOENT: no such file or directory, open '/Users/hvo/package.json'
Affected packages
- [ x ] cli
- core
- prompt
- config-angular
Possible Solution
downgrade read-pkg to 3.0.0 update the CLI to correctly use the new read-pkg API
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top Results From Across the Web
commitlint/config-angular: Versions
BREAKING CHANGES. cz-commitlint: users who is using multiple scopes need to set enableMultipleScopes to true. New Contributors.
Read more >Conventional Commits: A Better Way | by Michael Collins
The Conventional Commits specification introduces the BREAKING CHANGE footer token that is used to indicate that the commit introduces a non-backwards ...
Read more >pnpm-glitch - npm Package Health Analysis
The npm package pnpm-glitch receives a total of 1 downloads a week. ... An example of a pnpmfile.js that changes the dependencies field...
Read more >How To Automatically Generate A Helpful Changelog From ...
fix: a commit of this type patches a bug in your codebase and correlates with the patch version in ... A breaking change...
Read more >Changelog - Page ⋅ Storybook
devdeps: update dependency @scaleway/eslint-config-react to v3.10.2 ... devdeps: update dependency @commitlint/cli to v17.0.1 (#1515) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sweet victory.
Terrific job @byCedric. Next coffee is on me.
@byCedric Don’t mention it. You’ve been preventing worse things from happening for several months for us now. So the balance is still uneven.