npm install touches both package.json and package-lock.json even though they haven't been modified


(spike grobstein) #1

When running npm install, the modification time of both package.json and package-lock.json are updated, which is causing a trigger in both our Makefile and a watch command; the watch command is getting stuck in an infinite loop and is currently disabled.

Running with npm install --no-save still touches those files.

Is there any plan to resolve this issue?


(Markus Tacker) #2

Use npm ci instead, it won’t change the files: https://docs.npmjs.com/cli/ci


(spike grobstein) #3

it’s meant to be used in automated environments such as test platforms, continuous integration, and deployment.

This is part of the standard development workflow and not in any test platform/integration/deployment system. It also doesn’t solve for individual dependencies that come down the pipe, so it won’t properly install things after a git pull (according to the documentation). The ci command has a lot of limitations that prevent it from being a real solution to this problem and appears to be solving a completely, unrelated issue.

this really looks like a bug to me.


(system) #4

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.