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

-gc flag does not work #1073

Closed
ejoebstl opened this issue Jul 9, 2020 · 2 comments
Closed

-gc flag does not work #1073

ejoebstl opened this issue Jul 9, 2020 · 2 comments

Comments

@ejoebstl
Copy link

ejoebstl commented Jul 9, 2020

Expected Behavior

-gc flag should be accepted by ts_node, as discussed here.

Actual Behavior

Fails to parse param.

ts-node -gc script.ts
/usr/local/lib/node_modules/ts-node/node_modules/arg/index.js:92
						throw err;
						^

Error: Unknown or unexpected option: -g
    at arg (/usr/local/lib/node_modules/ts-node/node_modules/arg/index.js:90:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/ts-node/dist/bin.js:13:14)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Minimal reproduction

touch script.ts
ts-node -gc script.ts

Specifications

ts-node v8.3.0
node v10.18.1
compiler v3.9.5

Operating system and version: Linux archlinux 5.7.2-arch1-1

@cspotcode
Copy link
Collaborator

This is working as intended. We no longer attempt to spawn a child node process and pass it node flags.

If you need to pass extra flags to the node process, you can invoke node directly, telling it to load ts-node/register.

See also:
https://github.com/TypeStrong/ts-node#programmatic

Closing for now, because I think this adequately explains why it's working as intended. We can reopen as needed.

@ejoebstl
Copy link
Author

ejoebstl commented Jul 9, 2020

Thank you for the clarification. I was not aware of the changes.

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