Currently, my team and I are collaborating on an npm project at work which has dependencies on 'lodash' and 'jquery'.
After running '>npm install
' to fetch the dependencies and bundling the project, a 'package-lock.json' file is created on my local system.
If another developer adds a new dependency such as 'moment' and runs '>npm install -S moment
', it will be added to their package.json file which they check in. However, we do not include the package-lock.json file in the repository.
When pulling the updated package.json file using 'git pull
', and running '>npm install
', since I have my own package-lock.json file, the 'moment' dependency does not get installed for me. In this scenario, I have to remove the package-lock.json file and run '>npm install
' again to get the 'moment' package included.
This process of managing dependencies with package-lock.json seems to be causing some inefficiencies in our workflow. Can someone provide guidance on how developers should handle this situation when working collectively on an npm module on a daily basis?