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 doesn't run install scripts on packages #4738

Closed
vladfrangu opened this issue Sep 9, 2023 · 10 comments
Closed

Bun doesn't run install scripts on packages #4738

vladfrangu opened this issue Sep 9, 2023 · 10 comments
Labels
bug Something isn't working npm Something that relates to the npm-compatible client

Comments

@vladfrangu
Copy link

vladfrangu commented Sep 9, 2023

What version of Bun is running?

1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983

What platform is your computer?

Darwin 23.0.0 arm64 arm

What steps can reproduce the bug?

  1. bun install re2

What is the expected behavior?

Bun installs the module and runs its install script (which does work when done manually in the module's node_modules folder by calling bun run install)

What do you see instead?

The module doesn't get its script ran

Additional information

There seems to be another unrelated issue to re2, most likely related to the native layer not working between node and bun (which makes sense)

❯ bun repl                  
[0.06ms] ".env"
Welcome to Bun v1.0.0
Type ".help" for more information.
> import('re2')
dyld[89849]: missing symbol called
error: "bun-repl" exited with code 9 (SIGKILL)
@vladfrangu vladfrangu added the bug Something isn't working label Sep 9, 2023
@dszymon

This comment was marked as off-topic.

@Electroid Electroid added the npm Something that relates to the npm-compatible client label Sep 10, 2023
@Electroid
Copy link
Contributor

Thanks for reporting, we're going to fix this in the next release. Until then, you do the following:

package.json:

{
  "trustedDependencies": [
    "re2"
  ]
}

Remove, then add so postinstall script is run.

bun remove re2
bun add re2

@jakeboone02
Copy link
Contributor

Thanks for reporting, we're going to fix this in the next release.

@Electroid I'm curious what you're going to fix; the current documented behavior seems very intentional. Is bun install going to run lifecycle scripts like postinstall without whitelisting via trustedDependencies in the next release?

@intrnl
Copy link

intrnl commented Sep 10, 2023

implementing #3756 would make it clear whether or not dependencies' postinstall scripts needs to be ran

@uncenter
Copy link

#3756 (comment)
Warnings for skipped postinstall scripts is a must have! Is there any work being done for #3756?

@Mat-thieu
Copy link

@jakeboone02 I just hope the "fix" is a flag that disables this behaviour. I understand the value of having this as a default, it's good for new projects... but if you want to start using bun on an existing large project it's really clunky, quite a chore figuring out which dependencies are running pre/post.

@ineffyble
Copy link

For anyone struggling with getting the postinstall to run for a transitive dependency, delete both node_modules and bun.lockb, make sure the package is in dependencies and trustedDependencies, and then do a bun install.

@yoavTaieb
Copy link

yoavTaieb commented Sep 18, 2023

Same problem when Installing re2 . @Electroid solution fixed it but now bun run throw an error:

dyld[95891]: missing symbol called
[1] 95891 killed bun run index.ts

@Electroid
Copy link
Contributor

Duplicate of #4959

@Electroid Electroid marked this as a duplicate of #4959 Oct 26, 2023
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
@Jarred-Sumner
Copy link
Collaborator

Fixed by @dylan-conway and @paperdave in #7132

This will be part of the Bun v1.0.17 release, which ships in a few hours from the time of writing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working npm Something that relates to the npm-compatible client
Projects
None yet
Development

No branches or pull requests

10 participants