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

bun install uses wrong architecture (ngrok) #5251

Closed
rnovacek opened this issue Sep 13, 2023 · 3 comments
Closed

bun install uses wrong architecture (ngrok) #5251

rnovacek opened this issue Sep 13, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@rnovacek
Copy link

What version of Bun is running?

1.0.1+31aec4ebe325982fc0ef27498984b0ad9969162b

What platform is your computer?

Linux 6.4.13-100.fc37.x86_64 x86_64 x86_64

What steps can reproduce the bug?

bun add -D ngrok to install ngrok

❯ file node_modules/ngrok/bin/ngrok
node_modules/ngrok/bin/ngrok: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL>

It says Mach-O which is for Mac OS X, but I'm on Linux.

Running that binary fails with

exec: Failed to execute process: 'node_modules/ngrok/bin/ngrok' the file could not be run by the operating system.

In comparison, when installing with npm:

❯ file node_modules/ngrok/bin/ngrok
node_modules/ngrok/bin/ngrok: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=EvswazsS6a_vANIGcIqN/ItLxMQr-UxziHtWcQLeo/46ctc_6AkiOagVubS8OQ/qsB9O4YF8RIrjnI6eIQn, stripped

What is the expected behavior?

Linux x86_64 version of the ngrok package should be installed into node_modules.

What do you see instead?

Mac OS X version of the package is installed.

Additional information

❯ bun bun.lockb | grep ngrok
[0.43ms] ".env"
ngrok@^5.0.0-beta.2:
  resolved "https://registry.npmjs.org/ngrok/-/ngrok-5.0.0-beta.2.tgz"
@rnovacek rnovacek added the bug Something isn't working label Sep 13, 2023
@rnovacek
Copy link
Author

It actually does not use wrong architecture, the ngrok npm package has Mac OS X version bundled and on postinstall it downloads version for different architectures. And that's when bun fails:

❯ bun node_modules/ngrok/postinstall.js
[0.07ms] ".env"
arch linuxx64 cdn https://bin.equinox.io url https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.zip
ngrok - downloading binary https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.zip
ngrok - downloading progress: 
ngrok - error downloading from URL 121 | */
122 | class RequestError extends Error {
123 |     constructor(message, error, self) {
124 |         var _a, _b;
125 |         super(message);
126 |         Error.captureStackTrace(this, this.constructor);
            ^
RequestError: Attempted to assign to readonly property.
 code: "ERR_GOT_REQUEST_ERROR"

      at new RequestError (/home/radek/weareeight/Bundle-Builder/node_modules/got/dist/source/core/index.js:126:8)
      at _beforeError (/home/radek/weareeight/Bundle-Builder/node_modules/got/dist/source/core/index.js:1214:20)
      at /home/radek/weareeight/Bundle-Builder/node_modules/got/dist/source/core/index.js:952:12
      at processTicksAndRejections (:1:2602)

@rnovacek
Copy link
Author

That seems to be in the got package, so might get resolved by #4395 once that lands.

@Electroid
Copy link
Contributor

This issue will be fixed by #4959

@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants