npm install
and npm update
install files in node_modules
. The modified timestamps of these files are not what you expect: the time that these files were last installed or updated in the local filesystem. Instead, npm
deliberately (I think) ensures that the installed files' mtime
value remains the same as in the source archive.
That means, it is possible to find really old files in node_modules
:
$ stat node_modules/plotly.js-dist/plotly.js | grep Modify
Modify: 1985-10-26 09:15:00.000000000 +0100
The main issue with this is that I am using these files in a build process, which only triggers if the source file's mtime
is more recent than the target file's mtime
.
How can I configure npm
to update the mtime
of a file when it is installed or updated?