npm and pnpm projects¶
OSS IQ scans and updates JavaScript projects that use npm or pnpm. Both install from the npm registry, so the analysis is the same for both. What differs is the files OSS IQ reads and writes, and the command it runs to install. Part of the reference.
How OSS IQ picks the package manager¶
OSS IQ checks for pnpm first:
If
package.jsondeclares a manager, inpackageManager("pnpm@10.4.1") or indevEngines.packageManager, OSS IQ uses that one.If it declares none, a
pnpm-lock.yamlorpnpm-workspace.yamlbeside it makes the project a pnpm project.Otherwise, a
package.jsonmakes it an npm project. The lockfile is optional.
A declaration wins over files, so a leftover pnpm-lock.yaml in a project that declares npm
does not make OSS IQ run pnpm. The plan header names the manager OSS IQ detected:
───────────────────── OSS IQ — Plan: pnpm-workspace-config ─────────────────────
Package Manager: pnpm | Direct: 0 | Transitive: 0
...
Held by overrides you wrote — OSS IQ never rewrites those; update or remove them
to let these through:
Override Forces Declared in Keeps back
lodash 4.17.21 pnpm-workspace.yaml lodash@4.18.1
Files OSS IQ reads¶
npm |
pnpm |
|
|---|---|---|
Manifest |
|
|
Lockfile |
|
|
Overrides you wrote |
|
The |
Catalog ranges |
— |
|
Release cutoff |
— |
|
Overrides and package aliases follow the same rules under both managers. See Constraints, overrides and aliases.
What apply and add write and run¶
npm |
pnpm |
|
|---|---|---|
Direct dependency |
Range rewritten in |
Range rewritten in |
Transitive pick |
|
|
Record of what OSS IQ wrote |
|
|
|
|
|
Every install pass but the last adds |
|
|
|
|
|
Restored when a run fails |
|
|
New dependencies held to the cooldown |
No. The plan flags young ones with |
Yes, through |
Both managers run without install scripts. A package that needs a postinstall step (a native build
or a downloaded binary, as with esbuild, sharp or prisma) needs npm rebuild <name> or
pnpm rebuild <name> afterwards.
Under pnpm, apply also checks that every target landed. When pnpm installed a different version
than the plan picked, the run ends with “Update Incomplete”.
Limits¶
applyandaddneed pnpm 10 or later on yourPATH. Without it, the run stops and leaves the project files as they were.Older lockfiles are not read. npm’s
lockfileVersion1 and pnpm lockfiles older than 9.0 stop the scan with a parsing error.OSS IQ scans only the root project of a pnpm workspace. It reads the root importer (
.) ofpnpm-lock.yamland skips packages in other workspace folders.OSS IQ reports an override from
package.jsonas declared inpnpm-workspace.yaml. pnpm 9 and 10 also read overrides from thepnpmfield ofpackage.json, and OSS IQ labels those with the workspace file too.