Skip to content

Honor Nodejs environment variables - #24336

Closed
turran wants to merge 1 commit into
emscripten-core:mainfrom
turran:node-env
Closed

Honor Nodejs environment variables#24336
turran wants to merge 1 commit into
emscripten-core:mainfrom
turran:node-env

Conversation

@turran

Copy link
Copy Markdown

Be able to pass Node.js environment variables through the command line and make them available to Emscripten

@kleisauke

Copy link
Copy Markdown
Collaborator

This is a breaking change, see e.g. the discussion in PR #18820.

@turran

Copy link
Copy Markdown
Author

Thanks @kleisauke I wasn't aware of that PR.
I don't understand why such a change can be a breaking change. Not honoring node env is a missing feature as there is no way to pass environment variables other than manually modifying the .js file, which is impractical from the user PoV.

@sbc100

Copy link
Copy Markdown
Collaborator

Thanks @kleisauke I wasn't aware of that PR. I don't understand why such a change can be a breaking change. Not honoring node env is a missing feature as there is no way to pass environment variables other than manually modifying the .js file, which is impractical from the user PoV.

Its a little more subtle than that. Emscripten tends to present a kind of virtual environment. By default for example, we don't expose the user's actual filesystem, even under node. You have to opt into that behaviour. See https://github.com/emscripten-core/emscripten/pull/18820/files#r1114735936

I do think we want to enable this behaviour somehow, but it will likely need to be behind some kind of flag.

In any case this does appear to be a duplicate of #18820, no?

@turran

Copy link
Copy Markdown
Author

Duplicates #18820

@turranturran closed this Dec 22, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@turran@kleisauke@sbc100