just started using Infisifcal and love it thus far...
# infisical-feedback
b
just started using Infisifcal and love it thus far, but I've noticed our ci I need to do the following to solve an issue.
Copy code
- name: Restore dependencies
    run: |
      bun install --frozen-lockfile
      bun install --frozen-lockfile # Infisical fails to install in the first run
Otherwise I get this
Copy code
/usr/bin/bash: line 1: infisical: command not found
error: script "infisical" exited with code 127
We have Infisical listed as a trusted dep, Please let me know if it is something I am doing wrong or missing
✅ 1
p
Hi Bradley, This really sounds like a race condition in the installation due to how
bun
 handles the installation hooks. Are you using the CLI in your app or just in CI? If not, could you you install it directly on the CI using
bun install -g @infisical/cli
 and see if the behavior changes? If this doesn't help, could you share more details? 1. Which step in CI fails with
error: script "infisical" exited with code 127
? Could you share the step code? 2. Do you have any installation hooks in
package.json
 that rely on
infisical
 being present?
b
Both cli and ci Installing separately would work, but ideally it wouldn't be required.
Infisical
isn't called on any install scripts, we are simply calling
bunx turbo run build
or dev, etc which calls
infisical
on each sub package script
p
Hi @Bradley Blyther, The infisical CLI NPM installer has a postinstall script which is blocked by Bun by default. You'll need to add
@infisical/cli
 to your trusted dependencies. Please let me know if this helps!
b
This was already the case in our in our
package.json
file.
Copy code
"trustedDependencies": [
    "@infisical/cli"
  ]
p
Hi @Bradley Blyther, Thanks for checking. Your
trustedDependencies
setup is correct, so nothing's wrong on your end. This is a timing issue. The
@infisical/cli
package downloads the actual binary in a lifecycle script, and Bun runs those in parallel. So bun install can finish and report success before that download has actually written the binary to disk. Turbo then runs a moment too early and hits the 127 error. A cleaner way to handle it is to run the script explicitly. Drop the duplicate bun install and add this step right after your install:
Copy code
- run: bun pm trust @infisical/cli
bun pm trust
runs the lifecycle script synchronously and waits for it to finish, so the binary is definitely there before turbo runs. Let me know if this helps!
b
Hi @Daniel Hougaard Sadly this doesn't solve the issue. I get this error when running
bun pm trust @infisical/cli
Copy code
error: 0 scripts ran. The following packages are already trusted, don't have scripts to run, or don't exist:
 - @infisical/cli
and still get the following afterwards
Copy code
/usr/bin/bash: line 1: infisical: command not found
error: script "infisical" exited with code 127
p
Hi @Bradley Blyther, The likely reason that
bun pm trust
reports "0 scripts ran" is that it only runs lifecycle scripts for dependencies that are currently untrusted. Since you already have
@infisical/cli
in
trustedDependencies
, Bun considers the postinstall handled, so
bun pm trust
has nothing to do. The fix I'd recommend is to stop relying on the postinstall entirely and install the CLI as its own blocking step before turbo runs. The npm package is just a wrapper around the same binary, so installing it directly is more reliable in CI:
Copy code
- name: Install Infisical CLI
  run: |
    curl -1sLf '<https://artifacts-cli.infisical.com/setup.deb.sh>' | sudo -E bash
    sudo apt-get update && sudo apt-get install -y infisical
    infisical --version
The
infisical --version
line means the step fails fast if anything went wrong, instead of failing mysteriously later in the build. If you'd prefer to keep it managed by
bun install
, you can make
bun pm trust
work by removing
@infisical/cli
from
trustedDependencies
so the script is genuinely blocked, then trust it explicitly right after install:
Copy code
- run: bun install --frozen-lockfile
- run: bun pm trust @infisical/cli
With the package no longer pre-trusted,
bun pm trust
runs the postinstall synchronously and waits for it to finish before turbo runs.
✅ 1
b
thank you