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

Support repositories other than npmjs #1450

Closed
Roaders opened this issue Jul 16, 2021 · 2 comments · Fixed by #1621
Closed

Support repositories other than npmjs #1450

Roaders opened this issue Jul 16, 2021 · 2 comments · Fixed by #1621

Comments

@Roaders
Copy link

Roaders commented Jul 16, 2021

We currently can't install esbuild on our CI platform. I suspect that the initial attempt to install from npm fails as it's trying to create a temporary folder which will fail on our jenkins build due to file system access permissions. Installing from npmjs then fails as access to that is blocked. We have our own private npm repository.

The way this is usually handled is that an environment variable is used to specify where compiled binaries can be downloaded from.

@evanw
Copy link
Owner

evanw commented Jul 16, 2021

This sounds like a problem with your Jenkins setup. The installer needs to be able to create a temporary directory to be able to run npm to download the binary executable. And running npm is necessary to pick up any custom registry and/or proxy configuration.

One potential workaround is to download the binary executable yourself before installing esbuild and then use the ESBUILD_BINARY_PATH environment variable during the install to tell esbuild's install script that the binary executable already exists on the file system. That bypasses the part of the install script that tries to download the executable.

Another workaround may be to use the esbuild-wasm package instead of the esbuild package on your CI platform. It's cross-platform and doesn't use an install script so it shouldn't cause any installation problems. The drawback is that it's slower than the esbuild package, although that may not matter for CI.

People can have very custom requirements for all sorts of unusual environments that they want to install esbuild in and I'm trying to avoid adding lots of flags to the install script for everyone. Ideally the install script would "just work" and the package manager would deal with the OS-specific installation instead.

When I get some time next I'd like to experiment with an alternate installation strategy instead of going down the road of adding lots of flags: #789. The plan is to use optionalDependencies to cause npm to only install the binary executable package for the current OS.

@Roaders
Copy link
Author

Roaders commented Jul 22, 2021

in the end it was not an issue. It seems that the initial failure was because the automatic onboarding process failed so npm install did not work.
I still think it is worth allowing different repos to be used with an env variable though if you continue with this way of installing other dependencies.

I have solved the some problem (different libs required on different OSs) with optional dependencies as you suggest. It does work but users are left with a big ugly error message as the linux library attempts to install and compile itself on windows. It all works but a lot of usesr have reported it as a failed installation due to the ugly error. Just FYI.

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

Successfully merging a pull request may close this issue.

2 participants