Our .npmrc
file has the following to lock the runtime and dependencies to be exact versions:
#Make sure that we use the expected node and npm versions
engine-strict=true
save-exact=true
This mostly avoids the 'well, it's working on my computer issue' by writing exact version numbers in package.json
.
However, I noticed that the transitive dependencies on npm install
are still bringing in ^4.5.6
which re-opens the hole again. Is there a setting in .npmrc
to make these fixed versions as well, so that all developers on the team are 100% on the same versions?
Specifically, when any developer runs npm install xxxx
, it should never write any ^4.4.4
versions, transitive or not. The direct ones were fixed but transitive ones are still going into package.json
as ^4.4.4
. Over time, this leaves every developer on different versions of modules at the same git hash and we have a very hard time comparing different environments. Worse is when you check out code from 6 months ago and it uses different versions than you ran in production.