[Vuejs]-How should I handle different versions of JS libraries in different branches?

4👍

Different branches may contain different content for the package.json, either more/less dependencies or another version for the same ones. Therefore, when checking another branch is important to run npm install to make sure the required dependencies are installed on your local environment. In case that no change is detected the output of install command will return that nothing has been changed. The IDE may even help you out and suggest to run it only when needed as it is the case for WebStorm. To consider:

  1. Check package.json and package-lock.json into Git but not node_modules (it’s huge!)
  2. When adding a dependency make sure to git commit all the changes to these two files
  3. Whenever a branch is changed run npm install to make sure dependency requirements are met
👤Lucio

Leave a comment