Reputation: 3065
Can i run something like: npm install passport
from expressjs itself?
I want to check if i'm using a non installed module and install it before running the application.
Upvotes: 0
Views: 346
Reputation: 2790
To answer your question, yes, you should be able to check the FileSystem for specific files/folders using fs. I imagine you would need to parse your package.json and check the local node_modules or the global install path.
I would recommend a shell script to run npm install
and then fire up your app from within the same script.
npm install .
node <server> &
Upvotes: 1