I am an amateur developer and code some applications for home use. I use the Quasar framework for the front and Python for the back.
I have a git repository where
master holds my "production code" and I would like to try the new version of Quasar (which uses Vue 3).
My principal concern is about how to deal with the new dependences this new framework will bring.
The framework is bootstrapped through
quasar create testvue3 --branch next, which does all kinds of magical things, including installing
My understanding is that these libraries go into
node_modules, which is not checked in (it is in
My question: how should I switch between the
v2 branch (the one I will re-bootstrap my frontend on) when it comes to dependencies?
- should I check in
npm installwhen switching branches?
- or something else?
Note: Should "node_modules" folder be included in the git repository was suggested as a duplicate. While it has very useful information, it does not answer my question on how to deal with different branches (specifically how to switch between them and recover the right environment, library-wise)
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:
package-lock.jsoninto Git but not
- When adding a dependency make sure to
git commitall the changes to these two files
- Whenever a branch is changed run
npm installto make sure dependency requirements are met