Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0 CLI error #140

Closed
hc-12 opened this issue Mar 26, 2024 · 2 comments
Closed

v2.0 CLI error #140

hc-12 opened this issue Mar 26, 2024 · 2 comments

Comments

@hc-12
Copy link

hc-12 commented Mar 26, 2024

I'm getting the following error when executing sql-ts cli npm script:

> sql-ts --config sql-ts-config.json

node:internal/errors:484
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_INPUT_TYPE_NOT_ALLOWED]: --input-type can only be used with string input via --eval, --print, or STDIN
    at new NodeError (node:internal/errors:393:5)
    at defaultResolve (node:internal/modules/esm/resolve:1118:25)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ESMLoader.import (node:internal/modules/esm/loader:525:22)
    at node:internal/modules/run_main:58:28
    at loadESM (node:internal/process/esm_loader:91:11)
    at async handleMainPromise (node:internal/modules/run_main:65:12) {
  code: 'ERR_INPUT_TYPE_NOT_ALLOWED'
}

Node.js v18.12.1
@rmp135
Copy link
Owner

rmp135 commented Mar 28, 2024

I'm only able to recreate this if I manually put --input-type=module in the command that runs the CLI inside the .bin folder. By default this is omitted and it runs fine. I can't determine how that's being added.

However I have noticed that on Node 18 it fails at a later point, can you try updating to Node 20 and see if the error still persists?

@hc-12
Copy link
Author

hc-12 commented Apr 3, 2024

However I have noticed that on Node 18 it fails at a later point, can you try updating to Node 20 and see if the error still persists?

upgrading to node v20 - broke better-sqlite3 for me (WiseLibs/better-sqlite3#1027). The workaround mentioned in the issue does not seem to help

@rmp135 rmp135 closed this as completed in 099806c Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants