[Vuejs]-Npm install keeps on showing on other device as soon as a dependency is installed

0👍

You could do that, but you should not be doing that. IF u want to do that then all what you have to do is to track the node_modules folder from git, however again this is extremely not recommended.

The normal flow is to do what you exactly did, you declare the packages, and later anyone that wants to work on the project, they have to reinstall them.

There are many reasons that the normal flow is like what you described, and that it is not recommended to push node_modules to git, here are some of them:

  • pushing these modules will make the repo size extremely large
  • pushing these modules will make working between different people harder, because each update will cause conflicts in files you do not own
  • pushing these might make your project not work across different operating systems, some packages when installed have os specific code
  • pushing these will make it later hard to integrate with many automatic tools like ci/cd flows/ static linets, and many other tools

Leave a comment