My node.js application depends on the fact browserify is available on the command line, as it uses it on a shell script. How can I make sure it is available on the application without having to require my client to install it manually via npm install?
2 Answers
Since you're not giving too much context, I'm assuming that your external dependencies are located in ./node_modules in your app's directory.
In that case, just install browserify as an extra (local) dependency, which will make it available as ./node_modules/.bin/browserify. That's also how you can refer to it from your shell script.
Comments
An even better option is to install browserify as follows:
npm install --save browserify
This not only installs browserify for you, but also adds it as a dependency to your dependencies in your package.json file.
Now when someone installs your module i.e. via npm install yourmodule, browserify will be installed automatically into its ./node_modules.
This of course works for any module you depend on, not only browserify.