Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot commit files, @commitlint error

Matt Harris
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 3, 2023

When I try and commit a file, I get the error below. I can commit fine using the git cli. Any ideas?

Screenshot 2023-08-03 at 14.33.34.png

/node_modules/@commitlint/load/node_modules/cosmiconfig/dist/index.js:79

  const overrideOptions = metaConfig.config ?? {};

                                             ^
SyntaxError: Unexpected token ?

    at Module._compile (internal/modules/cjs/loader.js:872:18)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)

1 answer

0 votes
LynnG
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 5, 2026
It looks like the commit hook is running under an older Node.js version. The ?? operator used by @commitlint/load requires a newer Node release, so while commits work from the Git CLI, the GUI client may be invoking a different (older) Node runtime. I'd check the Node version used by SearchTree/SourceTree and compare it to node -v from the command line. Updating the client or configuring it to use the same Node version as your CLI should resolve the issue.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events