Open jezsung opened 9 months ago
Verify latest release
- [x] I verified that the issue exists in the latest pnpm release
pnpm version
8.10.0
Which area(s) of pnpm are affected? (leave empty if unsure)
CLI
Link to the code that reproduces this issue or a replay of the bug
No response
Reproduction steps
Add a
prepare
npm script and run thepnpm deploy
command. Theprepare
npm script runs as if you run thepnpm install
command.Describe the Bug
pnpm deploy
command runs npm scripts such asprepare
. It causes issues when running thedeploy
command with the--prod
flag. The command fails due to missing dependencies that the npm script requires.I'm not sure if npm scripts are supposed to be run when running the
deploy
command.A workaround for this issue is to use the
--ignore-script
flag.pnpm deploy --filter=app --ignore-script --prod ./prod
I confirmed the
--ignore-script
flag works but it's not documented currently.Expected Behavior
I think either npm scripts shouldn't be run or this behavior needs to be documented.
Which Node.js version are you using?
20.9.0
Which operating systems have you used?
- [x] macOS
- [ ] Windows
- [ ] Linux
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
That command is super buggy unfortunately...
And even worse, it runs prepare
scripts of all workspaces, despite the --filter
arg
I've run into the exact same thing and had a similar "a-ha" moment when I realized --ignore-scripts
works. imo this is a fantastic command, but needs a bit of love and documentation. I've run into similar, confusing issues https://github.com/pnpm/pnpm/issues/7286
Verify latest release
pnpm version
8.10.0
Which area(s) of pnpm are affected? (leave empty if unsure)
CLI
Link to the code that reproduces this issue or a replay of the bug
No response
Reproduction steps
Add a
prepare
npm script and run thepnpm deploy
command. Theprepare
npm script runs as if you run thepnpm install
command.Describe the Bug
pnpm deploy
command runs npm scripts such asprepare
. It causes issues when running thedeploy
command with the--prod
flag. The command fails due to missing dependencies that the npm script requires.I'm not sure if npm scripts are supposed to be run when running the
deploy
command.A workaround for this issue is to use the
--ignore-script
flag.I confirmed the
--ignore-script
flag works but it's not documented currently.Expected Behavior
I think either npm scripts shouldn't be run or this behavior needs to be documented.
Which Node.js version are you using?
20.9.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response