-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 failing on installing Optional binary dependency: cpu-features #2666
Comments
I cannot use bun with my project... |
We've fixed some issues with optional dependencies and |
This is still an issue for me on
@Electroid do you have any ideas why |
I guess the |
Whats the fix for this? I cant run my project because of this error |
@Hedronmx are you running Bun v1.0.30? (or a recent version of bun) |
@Jarred-Sumner Yes! Just updated to bun 1.0.30 trying to fix the error |
@Jarred-Sumner upgraded to 1.0.33 and i still cant run my project. How can i fix it? Am I missing something? Sorry to be bothering you |
For a workaround, use
diff --git a/node_modules/cpu-features/disabled.js b/disabled.js
new file mode 100644
index 0000000000000000000000000000000000000000..4d2d18c14a2f3334ce0227d2b9eabad3cb28e41c
--- /dev/null
+++ b/disabled.js
@@ -0,0 +1 @@
+throw new Error(`cpu-features not available on Bun`)
diff --git a/package.json b/package.json
index 6cc12c3c7703ea17995be61c5accc331e7e35014..da299bcca20a1a0654f6910c19d613ee776be478 100644
--- a/package.json
+++ b/package.json
@@ -3,10 +3,8 @@
"version": "0.0.10",
"author": "Brian White <mscdex@mscdex.net>",
"description": "A simple binding to Google's cpu_features library for obtaining information about installed CPU(s)",
- "main": "./lib/index",
+ "main": "./disabled.js",
"dependencies": {
- "buildcheck": "~0.0.6",
- "nan": "^2.19.0"
},
"devDependencies": {
"@mscdex/eslint-config": "^1.1.0", |
What version of Bun is running?
0.5.8
What platform is your computer?
Darwin 22.2.0 arm64 arm
What steps can reproduce the bug?
bun add ssh2-promise
Checked 63 installs across 64 packages (no changes) [31.00ms]
• electron-builder version=23.6.0
• loaded configuration file=/Users/mxtnr/xp/ee/skadi-app/electron-builder.yml
• rebuilding native dependencies dependencies=cpu-features@0.0.6 platform=darwin arch=arm64
⨯ cannot execute cause=exit status 1 errorOut=error: script not found "rebuild"
command=/Users/mxtnr/.bun/bin/bun rebuild cpu-features@0.0.6 workingDir=
172 packages installed [4.94s]
error: script "postinstall" exited with code 1 (SIGHUP)
error: script "dev" exited with code 1 (SIGHUP)
What is the expected behavior?
Install it (yarn does)
or just ignore this Optional dependency or add --no-optional flag like npm.
But it'll be super to skip only failing optional dependencies.
It's good idea to do it by default while suppressing error signal.
What do you see instead?
script not found "rebuild"
Additional information
ssh2@^1.10.0:
dependencies:
asn1 "^0.2.4"
bcrypt-pbkdf "^1.0.2"
optionalDependencies:
cpu-features "~0.0.4"
nan "^2.16.0"
The text was updated successfully, but these errors were encountered: