kristiandupont/kanel

Not working for me

Closed this issue · 5 comments

git clone https://github.com/kristiandupont/kanel.git
cd kanel
npx tsc
./bin/kanel
/Users/jribakoff/kanel/build/cli.js:43
var chalk_1 = __importDefault(require("chalk"));
                              ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/jribakoff/kanel/node_modules/chalk/source/index.js from /Users/jribakoff/kanel/build/cli.js not supported.
Instead change the require of index.js in /Users/jribakoff/kanel/build/cli.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/jribakoff/kanel/build/cli.js:43:31)
    at Object.<anonymous> (/Users/jribakoff/kanel/bin/kanel:2:1) {
  code: 'ERR_REQUIRE_ESM'
}
node -v
v16.13.2

Am I doing something wrong? Thanks in advance!

Turns out that Chalk 5.0.0 is a pure ESM. Since that bit is not covered by tests, it slipped through. I've downgraded chalk for now. Try pulling and see if that helps.

Thanks! One idea is to spawn a child process in jest :)

Unfortunately, even though the error was fixed I still struggle to get any output at all:

➜  kanel git:(master) ✗ ./bin/kanel  
➜  kanel git:(master) ✗ ./bin/kanel --help
➜  kanel git:(master) ✗ ./bin/kanel -h   

all terminate with no output or error printed to stdout or stderr as I would expect. I didn't find any docs in the readme, so I may be omitting important flags or doing something else wrong.

Hm, that's weird. Do you have a .kanelrc.js file in the folder where you are running it?

That said, if I run ./bin/kanel --help in my repo, I get this output:

Usage: kanel [options]

  -h, --help                 displays help
  -v, --version              displays version
  -c, --config path::String  Use this configuration, overriding .schemalintrc.* config options
                             if present

Version 2.4.1

So there must be something different in your setup. Is it the same if you run node build/cli --help?

@joshribakoff-sm does it work for you now?