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.
commitlint >= 8.3.0 reads package.json from install area
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'
downgrade read-pkg to 3.0.0
update the CLI to correctly use the new read-pkg API
Yeah. This broke all of our CI jobs today. Happy new year, I guess?
Hmm, that's weird, the only breaking change from read-pkg should be the node requirement. I'll create a fix asap! Meanwhile, you can use the npx @commitlint/cli. That should work just fine.
@byCedric I was under the impression that did not work either.
Or is it any different now?
Good catch, but that's related to using the configuration from your project. It's sort of similar, but not causing this error. It's related to an issue in a nested dependency where it looks in the wrong global npm/yarn folder for your config.
This error seems to originate from the commitlint alias. Right now it's not able to find the @commitlint/cli binary using the local package.json from commitlint. If this worked for you in 8.2.0, you are not affected by the issue you mentioned 馃槃
@byCedric Hey, good stuff! And thanks so much for the fix. Are you planning a patch release by any chance?
I'm sorry we broke your CI 馃槃 Yes, I'm running the release as we speak. I'll comment again with the version if I'm done 馃槃
@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.
You should be able to run npx commitlint again, version 8.3.4 is just released! Again, sorry for the inconvenience and we will do better next release! (I promise 馃槃) Please, do let us know if something else pops up! 鉂わ笍

Sweet victory.
Terrific job @byCedric. Next coffee is on me.
Most helpful comment
Sweet victory.
Terrific job @byCedric. Next coffee is on me.