Skip to content

Specify npm 11.* in engines to suppress version upgrade notices#404

Open
schneems wants to merge 1 commit into
mainfrom
schneems/update-npm-version
Open

Specify npm 11.* in engines to suppress version upgrade notices#404
schneems wants to merge 1 commit into
mainfrom
schneems/update-npm-version

Conversation

@schneems
Copy link
Copy Markdown
Contributor

@schneems schneems commented Jun 1, 2026

Node 24.16.0 bundles npm 11.13.0 but npm 11.16.0 has since been released. Since the buildpack uses whatever npm ships with the Node binary (there's no buildpack-level default to update), npm prints upgrade notices on every invocation during the build:

remote:        npm notice
remote:        npm notice New minor version of npm available! 11.13.0 -> 11.16.0
remote:        npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.16.0
remote:        npm notice To update run: npm install -g npm@11.16.0
remote:        npm notice

This block appears 5 times in the generated getting started tutorial (twice per deploy during install + prune, across 2 deploys + the db provision step).

Adding "npm": "11.*" to engines tells the buildpack to resolve and install the latest 11.x, which eliminates the notices.

Without an explicit npm version in engines, Heroku uses a default that
lags behind the latest release. This causes npm to print "New minor
version of npm available!" notices during every build, cluttering the
getting started tutorial output.
@schneems schneems requested a review from colincasey as a code owner June 1, 2026 23:18
@heroku heroku Bot temporarily deployed to getting-star-schneems-u-r7bgdl June 1, 2026 23:18 Inactive
@schneems schneems marked this pull request as draft June 1, 2026 23:21
Comment thread package.json
"engines": {
"node": "20.x || 22.x || 24.x"
"node": "20.x || 22.x || 24.x",
"npm": "11.*"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❯ /pr-review-toolkit:review-pr https://github.com/heroku/nodejs-getting-started/pull/404

  Critical Issues (0 found)

  None.

  Important Issues (0 found)

  None.

  Suggestions (1)

  - Version range specificity: "npm": "11.*" pins to npm 11.x. When a future Node major (e.g., 26.x) ships with npm 12+, this constraint will force the
  buildpack to downgrade npm. This is fine for a getting-started template (it'll get updated), but worth noting in a comment or the PR description that this
  will need a bump alongside any future Node major addition. (Already implicitly addressed by the PR description's context.)

  Strengths

  - Well-motivated: The PR body clearly explains the problem (5 noisy upgrade notices per tutorial build) and the mechanism (buildpack resolves + installs
  latest 11.x).
  - Minimal change: Only touches what's needed — no scope creep.
  - Correct JSON syntax: Trailing comma properly added to the preceding line.
  - Compatible range: npm 11 supports Node >= 20, which aligns with all listed engine versions (20.x, 22.x, 24.x).

  Recommended Action

  Ship it. This is a clean, low-risk fix that improves the developer experience for anyone following the getting-started tutorial.

@schneems schneems marked this pull request as ready for review June 1, 2026 23:36
Comment thread package.json
"engines": {
"node": "20.x || 22.x || 24.x"
"node": "20.x || 22.x || 24.x",
"npm": "11.*"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be more consistent with how we tend to document and use a major version range specifier:

Suggested change
"npm": "11.*"
"npm": "11.x"

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.

2 participants