I’m curious to know whether it is possible to have a common node modules folder for all my ionic project
You could symlink the node_modules
all to the same folder, but this is just begging for problems like mismatch between package.json and the content of the folder.
Yeah. To expand on the comment of @Sujan12: Ionic isn’t just one thing. It’s a collection of libraries, all of which depend on lots of other libraries. If you leave a project alone for a month and then come back to it, lots of small updates will have occurred, and your “old” project might not be ready for it. I try to update every few weeks, and I schedule time to do it, because I know it might take a while, if something weird happens. It’s better to keep project dependencies separate from one another, or you might become a slave to the update process.
To expand further, it’s extremely rare that you would have two apps that even want the same set of dependencies.
As long as you think of independent apps, this is true. But not when it comes to module and library development.
We are currently designing a platform based on ionic&angular. The basic idea is to have a set of (purely private) npm modules, and create different apps with these modules. From a maintenance point of view, it is important to make sure all modules use the same versions of dependencies.
Therefore it would be extremely useful to share the node_module folder across all our modules (and maybe even apps).