Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm install <dep>@versionOrTag does not honor save prefix #1888

Closed
aliatsis opened this issue Oct 1, 2020 · 3 comments
Closed

[BUG] npm install <dep>@versionOrTag does not honor save prefix #1888

aliatsis opened this issue Oct 1, 2020 · 3 comments
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@aliatsis
Copy link

aliatsis commented Oct 1, 2020

Current Behavior:

On the heels of #1849, npm v7.0.0-rc.0 does not include my configured ^ save prefix in devDependencies version when running an npm i <dep>@versionOrTag.

Expected Behavior:

npm i <dep>@versionOrTag should include my configured ^ save prefix on the updated version in package.json devDependencies

Steps To Reproduce:

  1. Install npm v7.0.0-rc.0
  2. npm i <dep>@prev-version where prev-version is the exact number version of a previous version
    3). observe no save prefix in package.json devDependencies for <dep>
    4). npm i <dep>@latest
    5). observe no save prefix in package.json devDependencies for <dep>

Environment:

Node: v10.15.3
NPM: v7.0.0-rc.0

@aliatsis aliatsis added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 1, 2020
@darcyclarke darcyclarke added beta and removed Needs Triage needs review for next steps labels Oct 1, 2020
@darcyclarke darcyclarke added this to the OSS - Sprint 17 milestone Oct 6, 2020
@darcyclarke darcyclarke self-assigned this Nov 30, 2020
@darcyclarke
Copy link
Contributor

@aliatsis can you try testing if this is still a problem after installing the latest version? (ie. 7.0.15)

@aliatsis
Copy link
Author

@darcyclarke I can still reproduce with 7.0.15

@darcyclarke darcyclarke removed their assignment Jan 8, 2021
@wraithgar wraithgar self-assigned this Jan 14, 2021
@wraithgar
Copy link
Member

I was not able to reproduce this in npm v7.4.1

I tried with both an .npmrc file in the project folder, and my ~/.npmrc file. I tried with both setting save-prefix=~ and save-prefix=^ and also with no save-prefix (which fell back to the default which is save-prefix=^

In each case I started with a package.json with no dependencies. Then ran

$ npm install [email protected] -D
$ npm install lodash@latest

I also tried

$ npm install [email protected] -D
$ npm install lodash@latest

To test updating without crossing a semver major boundary

In each case, the expected prefix was present in my package.json file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants