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 pm pack does not add node_modules to PATH for running scripts #16071

Open
Electroid opened this issue Dec 31, 2024 · 0 comments
Open

bun pm pack does not add node_modules to PATH for running scripts #16071

Electroid opened this issue Dec 31, 2024 · 0 comments
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@Electroid
Copy link
Contributor

Electroid commented Dec 31, 2024

When running bun pm pack, if there are lifecycle scripts to run, they don't have node_modules added to PATH.

For example:

$ husky
/opt/homebrew/bin/bash: line 1: husky: command not found
error: script "prepare" exited with code 127
❯ bun run prepare
$ printenv | grep PATH= && exit 1
npm_lifecycle_script=printenv | grep PATH= && exit 1
PATH=/Users/ashcon/Desktop/code/growth/uuid/node_modules/.bin:/Users/ashcon/Desktop/code/growth/uuid/node_modules/.bin:/Users/ashcon/Desktop/code/growth/node_modules/.bin:/Users/ashcon/Desktop/code/node_modules/.bin:/Users/ashcon/Desktop/node_modules/.bin:/Users/ashcon/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/opt/homebrew/opt/llvm@18/bin:/opt/homebrew/sbin:/opt/homebrew/opt/llvm@17/bin:/Users/ashcon/Desktop/code/bun/build:/opt/homebrew/opt/llvm@16/bin:/Users/ashcon/Desktop/code/bun/packages/debug-bun-darwin-aarch64:/opt/homebrew/bin:/Users/ashcon/.bun/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Users/ashcon/Library/pnpm:/Users/ashcon/.cargo/bin
error: script "prepare" exited with code 1
❯ bun pm pack
bun pack v1.1.39-canary.123 (3906d02e)
$ bun run build
$ node scripts/build.mjs
Building esm, cjs
Done: 891.619ms
$ printenv | grep PATH= && exit 1
npm_lifecycle_script=printenv | grep PATH= && exit 1
PATH=/opt/homebrew/opt/llvm@18/bin:/opt/homebrew/sbin:/opt/homebrew/opt/llvm@17/bin:/Users/ashcon/Desktop/code/bun/build:/opt/homebrew/opt/llvm@16/bin:/Users/ashcon/Desktop/code/bun/packages/debug-bun-darwin-aarch64:/opt/homebrew/bin:/Users/ashcon/.bun/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Users/ashcon/Library/pnpm:/Users/ashcon/.cargo/bin
error: script "prepare" exited with code 1
@Electroid Electroid added bug Something isn't working bun install Something that relates to the npm-compatible client labels Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client
Projects
None yet
Development

No branches or pull requests

1 participant