In the docs for Prettier (a code formatter), they install it with the --save-exact
flag (1):
npm install --save-dev --save-exact prettier
Since I have never heard of this flag, I looked it up in the npm docs (2):
-E, --save-exact
: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator.
I can see why they want every developer using the same version. But why does this seem to require the --save-exact
flag? As soon as package.lock
file is committed, shouldn't this serve the same purpose?