question-mark
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.

Bug: breaking API change in one of commitlint cli's dependencies: read-pkg

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
nfantonecommented, Jan 3, 2020

image

Sweet victory.

Terrific job @byCedric. Next coffee is on me.

3reactions
nfantonecommented, Jan 3, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found