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] Running npm install updates package.json timestamp #2714

Closed
coreyfarrell opened this issue Feb 16, 2021 · 2 comments
Closed

[BUG] Running npm install updates package.json timestamp #2714

coreyfarrell opened this issue Feb 16, 2021 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@coreyfarrell
Copy link

Current Behavior:

Running npm install with no arguments causes the timestamp of package.json to be touched.

Expected Behavior:

package.json should not be written.

Steps To Reproduce:

  1. Enter a directory with a valid package.json, observe the timestamp.
  2. Run npm install
  3. See that the package.json timestamp is updated.
  4. Wait a minute and repeat step 2-3, you see will se timestamp update again.

Environment:

  • OS: Fedora 32
  • Node: 15.8.0
  • npm: 7.5.4

Additional comment

This creates problems/annoyances for other programs that are watching for file updates. In my case running npm install causes my text editor to ask if I want to reload the file.

@coreyfarrell coreyfarrell 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 Feb 16, 2021
isaacs added a commit that referenced this issue Feb 18, 2021
* [#1875](#1875)
  [npm/arborist#230](npm/arborist#230) Set default
  advisory `severity`/`vulnerable_range` when missing from audit endpoint
  data ([@isaacs](https://github.com/isaacs))
* [npm/arborist#231](npm/arborist#231) skip
  optional deps with mismatched platform or engine
  ([@nlf](https://github.com/nlf))
* [#2251](#2251) Unpack shrinkwrapped deps
  not already unpacked ([@isaacs](https://github.com/isaacs),
  [@nlf](https://github.com/nlf))
* [#2714](#2714) Do not write package.json
  if nothing changed ([@isaacs](https://github.com/isaacs))
* [npm/rfcs#324](npm/rfcs#324) Prefer peer over
  prod dep, if both specified ([@isaacs](https://github.com/isaacs))
* [npm/arborist#236](npm/arborist#236) Fix
  additional peerOptional conflict cases
  ([@isaacs](https://github.com/isaacs))
@nlf nlf mentioned this issue Feb 22, 2021
@lumaxis
Copy link
Contributor

lumaxis commented Mar 11, 2021

Looks like this should have been fixed in 7.5.5, can this issue be closed?
@coreyfarrell Have you had a chance to validate that you're not seeing this anymore with the latest fixes?

@coreyfarrell
Copy link
Author

Yes this appears to be resolved (tested with 7.6.0).

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

No branches or pull requests

2 participants