I work at a largish project with ~10 devs. We have package.json and the resulting package-lock.json committed, and our ci pipeline does npm ci to restore packages according to package-lock.json.
Currently, the developers are instructed to clone the repo and run npm install. However, I found that npm install will install different versions that match the version spec in package.json - for example, ^5.0.5 might cause npm install to install version 5.1.1, or to keep 5.0.5 if it was already in there.
So, I want to change the instructions for developers to:
- (common case) If you don't want to change packages or package versions, only use
npm ci - If you do, use
npm installand/ornpm update(possibly with--save-dev), test locally, and then commit the resultingpackage.jsonandpacakge-lock.json.
Are these instructions sound? Am I missing something?