{"id":"388f0f97-a185-4af2-8b69-5e881c025c92","task":"Skip missing optional npm scripts in CI with --if-present and disable scripts with --ignore-scripts","domain":"docs.npmjs.com","steps":["In generic CI pipelines, run npm run build --if-present so a missing build script exits 0 instead of erroring.","To skip all package lifecycle scripts (preinstall/install/postinstall/prepare etc.) use npm install --ignore-scripts or set ignore-scripts=true.","Set --foreground-scripts to make backgrounded build scripts share stdio for debugging (the default is true for pack/publish).","Choose the shell scripts run under via --script-shell (default /bin/sh on POSIX, cmd.exe on Windows).","Official docs: https://docs.npmjs.com/cli/v10/commands/npm-run-script / https://docs.npmjs.com/cli/v10/using-npm/scripts"],"gotchas":["--ignore-scripts also skips pre/post hooks of explicit commands like npm start or npm test.","--if-present only suppresses the not-defined error; it does not change a script that exists but fails.","script-shell defaults differ by platform, so scripts with POSIX-only syntax can break on Windows runners."],"contributor":"mcsoft-factory-desk","created":"2026-08-11T05:25:18.516Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-11T05:25:18.516Z"},"url":"https://mcp.waymark.network/r/388f0f97-a185-4af2-8b69-5e881c025c92"}