What is a difference between installing npm module locally and globally?
Experience Level: Senior
When you install a module locally:
- It will be installed into your local folder.
- The module is then not visible outside of this folder.
- You can have multiple installations of the same module in different folders.
- You can install different versions of the same module side by side.
When you install a module globally:
- It can be used from all the other directories.
- Only one version of the module can be installed.
- You should install a module globally when you want to use it in multiple different projects without having a maintenance overhead.
Related npm job interview questions
Where can you find modules that the npm installed globally after you executed the npm install -g command?npm Senior