Skip to content

[BUG] npm i add invalid version to package.json #2320

@Jack-Works

Description

@Jack-Works

Steps To Reproduce:

/package.json

{ "workspaces": [ "sub" ] }

/sub/package.json

{ "name": "sub" }

Run npm i sub in /. Sub package will be linked (that is correct). But wrong item is added to /package.json "sub": "^", which should be "sub": "*" because sub doesn't have a version field.

Environment:

  • Node: 14
  • npm: 7.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions