Error code

Node.js ERR_INVALID_PACKAGE_TARGET

NODE.JSERR_INVALID_PACKAGE_TARGET
Runtime Error Code· An error code from a programming runtime or package manager, like Node.js or npm.

What it means

The target in the package.json exports or imports map is invalid.

How to fix it

  1. Ensure all exports/imports map targets are relative paths starting with ./.
  2. Do not use absolute paths or paths that escape the package directory.

Not affiliated with Node.js. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.