Skip to content

Chore/1445 node version pinning#1495

Closed
Oluwasuyi-Timilehin wants to merge 1 commit into
dotandev:mainfrom
Oluwasuyi-Timilehin:chore/1445-node-version-pinning
Closed

Chore/1445 node version pinning#1495
Oluwasuyi-Timilehin wants to merge 1 commit into
dotandev:mainfrom
Oluwasuyi-Timilehin:chore/1445-node-version-pinning

Conversation

@Oluwasuyi-Timilehin

Copy link
Copy Markdown

#closes #1445

Title

fix(package): add engines field to enforce Node.js >= 18.0.0

Description

Adds the engines field to package.json to enforce Node.js version >= 18.0.0 for the protocol handler and audit scripts. This ensures the project runs on a supported Node.js version and provides clear version requirements to users and CI/CD systems.

Related Issues

Closes #1445

Motivation

The package.json file lacked an engines field, which meant there was no explicit version requirement for Node.js. This could lead to:

  • Users running the project on unsupported Node.js versions
  • Unexpected behavior due to API differences between Node versions
  • CI/CD systems not enforcing version constraints
  • Protocol handler and audit scripts potentially failing on older Node versions

By adding the engines field, we:

  • Enforce a minimum Node.js version requirement
  • Provide clear documentation of version requirements
  • Enable npm/yarn to warn users if they're using an unsupported version
  • Ensure protocol handler and audit scripts run on compatible Node versions

Changes Made

  • Modified package.json to add the engines field
  • Added "node": ">= 18.0.0" as the version requirement
  • No other files modified
  • No breaking changes (only adds a constraint)

Testing

Verification Steps

  1. Verify the package.json change

    cat package.json | grep -A 2 "engines"

    Expected output:

      "engines": {
        "node": ">= 18.0.0"
      }
  2. Validate JSON syntax

    node -e "console.log(JSON.stringify(require('./package.json'), null, 2))"

    Expected: No syntax errors, valid JSON output

  3. Check current Node.js version

    node --version

    Expected: Should show version >= 18.0.0 (e.g., v18.x.x, v20.x.x, etc.)

  4. Verify npm recognizes the engines field

    npm view . engines

    Expected: Should display { node: '>= 18.0.0' }

  5. Test with npm

    npm install

    Expected: If Node version meets requirement, installation proceeds normally. If Node version is below 18.0.0, npm will show a warning.

  6. Verify the change matches the issue requirement

    • The engines field is present in package.json
    • The Node version requirement is >= 18.0.0
    • This enforces the expected Node version for protocol handler and audit scripts

Expected Behavior

  • npm and yarn will warn users if they're using Node.js < 18.0.0
  • CI/CD systems can enforce the Node version requirement
  • No functional changes to existing code
  • Protocol handler and audit scripts will run on supported Node versions

Checklist

  • Code follows style guidelines
  • Changes are minimal and focused
  • No breaking changes introduced
  • Documentation updated (this PR description)
  • package.json modification is correct
  • JSON syntax is valid
  • Ready for local testing

Impact Assessment

Benefits

  • Enforces minimum Node.js version requirement
  • Provides clear version documentation to users
  • Enables npm/yarn to warn about incompatible versions
  • Ensures protocol handler and audit scripts run on compatible Node versions
  • Aligns with modern Node.js best practices

Compatibility

  • No breaking changes to existing functionality
  • Only adds a version constraint
  • Users on Node.js >= 18.0.0 will see no change
  • Users on Node.js < 18.0.0 will receive a warning from npm/yarn
  • CI/CD systems can now enforce the version requirement

Version Rationale

  • Node.js 18.0.0 is the minimum version for:
    • Modern JavaScript features used in the codebase
    • Protocol handler functionality
    • Audit script dependencies
    • Security updates and performance improvements
  • This aligns with the project's dependency requirements (@types/node ^25.0.10)

Additional Notes

  • The engines field is a standard package.json field supported by npm and yarn
  • This is a simple, low-risk change with high value for version management
  • Node.js 18.x is an LTS release, providing long-term stability
  • This change follows npm best practices for specifying engine requirements

#closes

@drips-wave

drips-wave Bot commented Jun 2, 2026

Copy link
Copy Markdown

@Oluwasuyi-Timilehin Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dotandev

dotandev commented Jun 2, 2026

Copy link
Copy Markdown
Owner

fix conflicts.

@Oluwasuyi-Timilehin

Copy link
Copy Markdown
Author

@dotandev I already fixed conflicts.

@Oluwasuyi-Timilehin Oluwasuyi-Timilehin force-pushed the chore/1445-node-version-pinning branch from 31997cc to 0eafa35 Compare June 11, 2026 19:58
@dotandev dotandev closed this Jun 24, 2026
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.

Add Node.js version pinning in package.json

2 participants