Skip to content

Conversation

@MaxBlack-dev
Copy link
Contributor

@MaxBlack-dev MaxBlack-dev commented Nov 30, 2025

Description

This PR clarifies that the version field in package-lock.json dependency objects can be omitted in certain cases, specifically for peer dependencies and optional dependencies that are not installed.

Changes

  • Added a note to the version field documentation explaining when it may be omitted
  • Clarifies that peer dependencies and optional dependencies that are not installed may not have a version field

Fixes

Closes #4796

Context

The current documentation states that dependency objects have a version field but doesn't mention that this field can be absent in some cases. Users encountering package-lock.json files with entries without a version field were confused because the documentation implied the field is always present. This change makes it clear that the version field may be omitted for peer/optional dependencies that are not installed.

Type of Change

  • Documentation update

@MaxBlack-dev MaxBlack-dev requested a review from a team as a code owner November 30, 2025 01:17
@owlstronaut owlstronaut merged commit 1298530 into npm:latest Dec 1, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] Details for package-lock.json dependencies version field missing

2 participants