I am new to node, i have made few small application using node, but everytime i have to use
npm install express -g
Every node application that has a
package.json has a specific set of rules for using specific versions of it's modules. You can install globally only one version of a specific module, but if you happen to have an application that needs an older / newer version that is not installed globally on your dev environment, then it will fail to work.
The recommended way of using node modules ( packages ) is to have a local directory inside your project, which contains all libraries that the project needs. This practice is everywhere and so you should follow it.
There are some ways to mitigate the slow
npm install, though.
There is a new
npm-replacement, created and maintained by Facebook, called
yarn does is it creates a local cache of all installed packages and then symlinks them to your project folder from your local computer cache. This way the
npm install procedure becomes very fast.