Skip to content

ci: --force on npm self-upgrade to dodge MODULE_NOT_FOUND#4

Merged
stevensacks merged 1 commit intomainfrom
ci/npm-force
Apr 27, 2026
Merged

ci: --force on npm self-upgrade to dodge MODULE_NOT_FOUND#4
stevensacks merged 1 commit intomainfrom
ci/npm-force

Conversation

@stevensacks
Copy link
Copy Markdown
Contributor

Summary

Adds --force to the npm install -g npm@latest step from PR #3.

Why

Without --force, npm tries to rebuild itself mid-install and the rebuild step fails with:

```
npm error code MODULE_NOT_FOUND
npm error Cannot find module 'promise-retry'
```

This is a known npm self-upgrade bootstrap regression — the old npm's node_modules get partially removed before the new npm is fully installed. --force skips the problematic rebuild and stages the new npm cleanly.

🤖 Generated with Claude Code

PR #3 added `npm install -g npm@latest` but it failed at runtime with
MODULE_NOT_FOUND on promise-retry — a well-known npm self-upgrade
bootstrap bug where modules unload mid-rebuild. `--force` skips the
problematic rebuild step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stevensacks stevensacks merged commit f3633b9 into main Apr 27, 2026
1 check passed
@stevensacks stevensacks deleted the ci/npm-force branch April 27, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant