I have a node app that I just started working with and each time I try to run it, it says there is a missing module. I've just been using npm install ...
for each module but after doing about 10 of them I'm wondering if there is a way to have npm pull down all needed modules for a node app without me installing each one manually. Can it be done?
It's simple. If you want to install all the node_modules from the package. json file you simply put: npm install in terminal (on the same directory where the package. json exists) and it would install all the node modules in the folder called node_modules .
To install a module from npm globally, you'll simply need to use the --global flag when running the install command to have the module install globally, rather than locally (to the current directory). Note: One caveat with global modules is that, by default, npm will install them to a system directory, not a local one.
Yes, as long as the dependency is listed in package.json
.
In the directory that contains package.json
, just type:
npm install
I created an npm module to handle installing missing modules automatically.
npm-install-missing
It will install all app dependencies and sub-dependencies automatically. This is useful when submodules aren't installed correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With