Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

not able to set multiple options through --options or through NODE_OPTIONS #1132

Closed
yogeshbiz opened this issue Apr 14, 2021 · 4 comments
Closed

Comments

@yogeshbiz
Copy link

Using pkg 4.5.1.

stuck on setting multiple options. does not works however tried. Any simple thing I am missing?

pkg app.js --options max-old-space-size=256 tls-min-v1.0

actually there are some options I need to add

using SET NODE_OPTIONS=--max-old-space-size=256 --tls-min-v1.0
does not works at all with multiple options.
Single quote, double quote... all variations do not work.

The compiled EXE only picks up 1 option through NODE_OPTIONS
That means 1 option baked in EXE OR 1 through NODE_OPTIONS. This is not enough.

With baked 1 option in EXE, and setting 1 option in NODE_OPTIONS, EXE crashes

No example, no documentation of multiple options setup to EXE.
If not supported, there is no mention. It is dead end with no road sign.

Since #447 is closed, what was resolution? There is no feedback or fix or resolution on close.

@erossignon
Copy link
Contributor

erossignon commented Apr 14, 2021

try --options max-old-space-size=256,tls-min-v1.0 ( no space , comma separated )

@Hypfer
Copy link
Contributor

Hypfer commented Apr 18, 2021

Unfortunately, running 63f4ce0, this isn't fixed.

Building a binary with --options expose-gc,max-heap-size=34 results in bad option: --expose-gc max-heap-size=34 being logged by the resulting binary

@Hypfer
Copy link
Contributor

Hypfer commented Apr 18, 2021

This is what is does currently
image'

And this is what it did before
image

@Hypfer
Copy link
Contributor

Hypfer commented Apr 18, 2021

As it turns out, writing --options "expose-gc,max-heap-size=34" actually produces the desired result.

Without that, argv.options becomes '--expose-gc max-heap-size=34' which of course won't be split at the , because there is no , which leads to the observed behaviour.
As for why that happens now and just now.. I have no idea. might be caused by some dependency upgrade or something.

robertsLando added a commit that referenced this issue Apr 23, 2021
)

Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants