Skip to content

[Bug] Missing NAPI configuration in package.json causes npm install failure in v1.8.0 #147

@noomorph

Description

@noomorph

Summary

Version 1.8.0 of unrs-resolver is missing required NAPI configuration in its package.json, causing npm install to fail with napi-postinstall errors.

Error Details

npm error Error: [napi-postinstall@0.2.4] No `napi.targets` nor `napi.triples.additional` field found in `unrs-resolver`'s `package.json`. Please ensure the package is built with NAPI support.
    at getNapiInfoFromPackageJson (/path/to/node_modules/napi-postinstall/lib/helpers.js:55:15)
    at checkAndPreparePackage (/path/to/node_modules/napi-postinstall/lib/index.js:168:88)

Environment

  • Node.js version: 22.14.0
  • npm version: 10.8.2
  • OS: macOS 24.5.0 (darwin)
  • unrs-resolver version: 1.8.0

Steps to Reproduce

  1. Create a blank project
  2. Run npm install unrs-resolver
  3. Installation fails with NAPI configuration error

Expected Behavior

npm install should complete successfully as it did in previous versions.

Actual Behavior

Installation fails because napi-postinstall cannot find the required napi.targets or napi.triples.additional fields in the package.json.

Root Cause

The package.json in v1.8.0 appears to be missing the NAPI configuration fields that napi-postinstall@0.2.4 expects to find for native packages.

Workaround

Downgrading to v1.7.13 works fine:

{
  "overrides": {
    "unrs-resolver": "1.7.13"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions