di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
6.15k stars 328 forks source link

Cannot setup opencommit #119

Closed mushunrek closed 1 year ago

mushunrek commented 1 year ago

I installed opencommit through npm as described on the Github page. However, when I tried to setup the API_KEY, I got the following error message:

/usr/local/lib/node_modules/opencommit/out/cli.cjs:15363
    throw new Error(`${n} cannot contain ${h(r2?.[0])}`);
                                                ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

Thanks in advance!

tombiato commented 1 year ago

Hey, I think you don't use the right npm version, try to change it with nvm

mushunrek commented 1 year ago

Thanks, that worked!