npm / npm/rfcs

[RRFC] Add package.json support to require a minimum Node.js N-API version

Open
#369 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
777
Forks
267
PR merge metrics
No merged PRs in 30d

Description

Motivation ("The Why")

Node.js binary add-ons that depend on the N-API interface are coded to an N-API version. There is no good way to prevent npm installing on an incompatible Node.js version. The package.json engines specification can be seen as a partial solution, but isn't ideal.

Example

npm install mymodule should fail to install into Node.js if the N-API required by mymodule is not supported by the Node.js engine.

How
Desired Behaviour

Add package.json syntax to allow installation of a Node.js add-on only for a given (or greater) N-API ABI version, and to gracefully fail otherwise.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation file, test, or entry point is named in the issue. Start by reviewing the proposed package.json syntax, npm install behavior, and the linked N-API version matrix; done means the proposal defines how incompatible Node.js versions are rejected gracefully.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.