Title: `ng update` reinstalls with lifecycle scripts skipped and no notice (since 22.3.0-next.5) · Issue #34688 · angular/angular-cli · GitHub
Open Graph Title: `ng update` reinstalls with lifecycle scripts skipped and no notice (since 22.3.0-next.5) · Issue #34688 · angular/angular-cli
X Title: `ng update` reinstalls with lifecycle scripts skipped and no notice (since 22.3.0-next.5) · Issue #34688 · angular/angular-cli
Description: Command update Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 22.2.6 (every stable release; also 22.3.0-next.4) Description Since 22.3.0-next.5, th...
Open Graph Description: Command update Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 22.2.6 (every stable release; also 22.3.0-nex...
X Description: Command update Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 22.2.6 (every stable release; also 22.3.0-nex...
Opengraph URL: https://github.com/angular/angular-cli/issues/34688
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`ng update` reinstalls with lifecycle scripts skipped and no notice (since 22.3.0-next.5)","articleBody":"### Command\n\nupdate\n\n### Is this a regression?\n\n- [x] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n22.2.6 (every stable release; also 22.3.0-next.4)\n\n### Description\n\nSince `22.3.0-next.5`, the final \"Installing packages\" step of `ng update` passes the package\nmanager's ignore-scripts flag (`npm install --ignore-scripts`; `--mode=skip-build` for modern yarn).\nFor npm, the update first deletes `node_modules` (\"Cleaning node modules directory\"), so after the\nreinstall **every** dependency's `preinstall`/`install`/`postinstall` script — including the\nproject's own root `postinstall` — has been skipped. Nothing re-runs them, nothing is printed, and\nthere is no flag to opt out. For pnpm/yarn/bun there is no wipe, but scripts of the packages changed\nby the update are skipped the same way.\n\nProjects that rely on lifecycle scripts break in ways that are hard to connect back to the update:\n\n- `patch-package` via root `postinstall`: patches are silently not applied, and the migrations that\n run right after the install operate on the unpatched tree;\n- `puppeteer`, `cypress`, and similar packages whose postinstall downloads a platform binary.\n\nThis comes from a69fe511c (\"default ignoreScripts to true when install options are provided\"). In\nall released versions the final install runs scripts normally: v21.0 still used the legacy\n`installAll()` (no flag), and from 21.1 through 22.2 the `= { ignoreScripts: true }` parameter\ndefault on `install()` was replaced entirely by the options object the update command passes\n(`{ ignorePeerDependencies }`), so the flag was never added. a69fe511c makes the default apply\nper property, which looks right for the temporary tooling installs — but it also silently turns on\nscript skipping for the final, persistent install of the user's project.\n\nIf skipping scripts here is intended, could the command print a notice (e.g. \"Lifecycle scripts were\nskipped during installation; run your package manager's install/rebuild command to execute them\")\nand/or offer an opt-out? Otherwise, the final install could pass `ignoreScripts: false` to restore\nthe stable-release behavior.\n\n### Minimal Reproduction\n\n1. `npx @angular/cli@22.2 new repro --defaults && cd repro`\n2. Add a visible root lifecycle script to `package.json`:\n `\"postinstall\": \"node -e \\\"require('node:fs').writeFileSync('postinstall-ran.txt','yes')\\\"\"`\n3. `npm install` → `postinstall-ran.txt` is created. Delete it: `rm postinstall-ran.txt`\n4. `npm install --save-dev --save-exact @angular/cli@22.3.0-next.5`\n5. `npx ng update @angular/core --next`\n6. After \"Cleaning node modules directory\" and \"Installing packages\" finish, `postinstall-ran.txt`\n does not exist — no install script ran, with no notice. Repeating steps 4–5 with\n `@angular/cli@22.3.0-next.4` in step 4 recreates the file.\n\n### Exception or Error\n\n```text\n(none — the scripts are skipped without any notice, which is the issue)\n```\n\n### Your Environment\n\n```text\n_ _ ____ _ ___\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\n |___/\n \n\nAngular CLI : 22.3.0-next.5\nNode.js : 24.15.0\nPackage Manager : yarn 1.22.22\nOperating System : darwin arm64\n```\n\n### Anything else relevant?\n\nCode on `main`:\n\n- `packages/angular/cli/src/commands/update/cli.ts:568-602` — the npm-only \"Cleaning node modules\n directory\" task followed by `packageManager.install({ ignorePeerDependencies })`, with no\n `ignoreScripts` override;\n- `packages/angular/cli/src/package-managers/package-manager.ts:397` —\n `const { force, ignoreScripts = true, ignorePeerDependencies } = options;` in `install()`.\n\nDefaulting to ignore-scripts for the temporary package acquisitions (`ng add`/`ng update` tooling\ninstalls) is good hardening and not what this issue is about — only the final project install.\nReproduces with every package manager; npm is affected most because of the preceding `node_modules`\nwipe. Not OS- or browser-specific.","author":{"url":"https://github.com/MeAkib","@type":"Person","name":"MeAkib"},"datePublished":"2026-11-11T20:44:53Z","url":"https://github.com/angular/angular-cli/issues/34688"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:036f1387-99a6-5f47-ed4a-784a37ffcfb4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C1C:10531B:276487D:32663E4:6B01DE93 |
| html-safe-nonce | 26c901173f457be0f162cb306e834dcfa2ba0e78004b697e466e987ea8d3885f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzFDOjEwNTMxQjoyNzY0ODdEOjMyNjYzRTQ6NkIwMURFOTMiLCJ2aXNpdG9yX2lkIjoiODk1MDg0NDQwMjIzNDk0MTA3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6f2d335f6884d9c76ebeaf0e7185c236b03b63586e738f3e480d0f7d841dd672 |
| hovercard-subject-tag | issue:6336867735 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/34688/issue_layout |
| twitter:image | https://opengraph.githubassets.com/26c6be98cba89bd19daa9200a9564451636b0f5c5d923b4deaac538046a90f29/angular/angular-cli/issues/34688 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/26c6be98cba89bd19daa9200a9564451636b0f5c5d923b4deaac538046a90f29/angular/angular-cli/issues/34688 |
| og:image:alt | Command update Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 22.2.6 (every stable release; also 22.3.0-nex... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MeAkib |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width