-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
Pass --max-old-space-size flag through to Node #261
Comments
Huh, it's |
Is this information still accurate? Maybe this should be added to the documentation? |
I'd like to put the answer right at here because this thread is on top of the google search ''ts-node max-old-space-size" node -r ts-node/register --max-old-space-size=3049 UpdateIf you are running with
|
Ok, this makes it possibe to pass node options. However, with this solution I wonder how to pass ts-node options (like |
since there is no obvious answer in this thread, here's how i ended up adding the flag: node --max-old-space-size=4096 -- node_modules/.bin/ts-node -P tsconfig.json index.ts |
why not just add a flag to ts-node and have it work as a passthrough? |
ts-node does not actually invoke a node process. By the time ts-node is executing, it is already within a node process, and we don't want to invoke another one. So passing CLI flags to node is not something we can do. If we were to conditionally spawn a node process based on certain flags, this would add a bunch of complexity. The recommended solution, mentioned here, is also explained in our README. Use |
Basically what @cspotcode said. We used to do this, then there were numerous requests for other flags to pass through. I believe it also created some obscure issues. Honestly just wasn't something we had bandwidth to maintain, and node's |
guys, I had an error with that solution:
for me it works fine with that fix:
ts-node: 8.10.1 |
@KEMBL in your case, node_modules/.bin/ts-node maybe a shell script |
It works for some case, but if you used advanced features, may get the error of |
Without seeing a reproduction, this sounds like a problem with your code,
not ts-node.
…On Tue, Jun 30, 2020, 6:55 AM Beeno Tung ***@***.***> wrote:
node --max-old-space-size=4096 -- node_modules/ts-node/dist/bin.js -P tsconfig.json index.ts
It works for some case, but if you used advanced features, may get the
error of Error: Cannot find module 'tslib'
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OGYU4FVHU4JUEVJZHTRZHACFANCNFSM4C3IASOA>
.
|
I see you have posted this several times, however it's not clear where to put max_old_space_size |
do you have an example of this ? I tried this but I get no output to confirm it when i run ts-node
|
If you use ESM for ts-node
|
This controls the amount of memory that the node process is able to use.
The text was updated successfully, but these errors were encountered: