Skip to content

Document the meaing of peer in the package-lock.json documentation. #1773

@dwjohnston

Description

@dwjohnston

I am currently trying to diagnose why a package-lock.json is being changed - the behaviour appears to be different between versions 10 and 11 of npm.

On version 11 of npm I see diffs that look like this:

     "node_modules/@aws-amplify/core": {
       "version": "6.13.0",
       "license": "Apache-2.0",
+      "peer": true,
       "dependencies": {

I can not ascertain the meaning of this property.

It is not documented here:

https://docs.npmjs.com/cli/v11/configuring-npm/package-lock-json#packages

I do see this line

bin, license, engines, dependencies, optionalDependencies: fields from package.json

This seems like an incomplete list, for example I can see diffs that mention cpu and os

+    "node_modules/@parcel/watcher-android-arm64": {
       "version": "2.4.1",
+      "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.1.tgz",
+      "integrity": "sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==",
+      "cpu": [
+        "arm64"
+      ],
       "dev": true,
       "license": "MIT",
       "optional": true,
-      "dependencies": {
-        "detect-libc": "^1.0.3",
-        "is-glob": "^4.0.3",
-        "micromatch": "^4.0.5",
-        "node-addon-api": "^7.0.0"
-      },
+      "os": [
+        "android"
+      ],

However - I assume that these properties come from package.json : see: https://docs.npmjs.com/cli/v11/configuring-npm/package-json#os

There is no such property peer on package.json - so I'm still at a loss to what it means.

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