Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Update overwriting tilde version number with caret #19585

@patrickhousley

Description

@patrickhousley

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

When I run npm install, it is not installing the latest version of dependencies that use the ~ in the version. When I run npm update, it is updating the version in the package.json for dependencies that use ~ to ^.

How can the CLI team reproduce the problem?

  1. npm init a new directory
  2. Add "@angular/common": "4.2.0" to the package.json as a dependency
  3. npm i
  4. Change the dependency version to "~4.2.0"
  5. npm i
  6. Observe the latest patch version of the dependency was not installed. The version in the package-lock.json was respected. This is inconsistent with how the package-lock.json is treated when using version numbers with a ^.
  7. npm update
  8. Observe the dependency version number was updated to ^4.2.6. npm update should not change the ~ to ^.

supporting information:

  • npm -v prints: 5.6.0
  • node -v prints: 8.9.3
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Windows
  • Network issues:
    • Geographic location where npm was run:
    • I use a proxy to connect to the npm registry.
    • I use a proxy to connect to the web.
    • I use a proxy when downloading Git repos.
    • I access the npm registry via a VPN
    • I don't use a proxy, but have limited or unreliable internet access.
  • Container:
    • I develop using Vagrant on Windows.
    • I develop using Vagrant on OS X or Linux.
    • I develop / deploy using Docker.
    • I deploy to a PaaS (Triton, Heroku).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions