Skip to content

Conversation

@unsegnor
Copy link

@unsegnor unsegnor commented Oct 20, 2024

Allow using Installer programatically regardless of the NODE_ENV variable value.

I was looking for a way to install chromedriver as a javascript function.
I did this in the beginning of the file:

let previousNodeEnv = process.env.NODE_ENV
process.env.NODE_ENV = 'test' //this is needed to get the ChromedriverInstaller from chromedriver/install
process.env.DETECT_CHROMEDRIVER_VERSION = true
const ChromedriverInstaller = require('chromedriver/install')
process.env.NODE_ENV = previousNodeEnv

It would be nice if I could avoid those env variables and call the method with parameters.
Or at least avoid having to set the NODE_ENV, which is the goal of this PR :)

Allow using Installer programatically regardless of the NODE_ENV variable value
@giggio
Copy link
Owner

giggio commented Oct 21, 2024

The problem is that the installer module is not part of the exposed interface, so this is why it is hidden behind a flag.
If I was to expose it then I would not be able to change this file freely, anymore. For example, I would not be able to rename install to something else.
I'd prefer to reflect on what would be exposed, and if it is worth the effort.

@stale stale bot added the wontfix label Apr 26, 2025
Repository owner deleted a comment from stale bot Apr 29, 2025
@stale stale bot removed the wontfix label Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants