Browserify is not suitable for work.
As the name implies, the browser needs to be used to generate the files that you want to execute in the browser. It makes the required calls from the entry point (i.e., some JS file that you pass to the browser) and binds them in an object that maps their names to functions that wrap the modules. He does not expect that the require function already exists and does not use it. It replaces its own implementation of require , which only does one thing: look at the names from the package, execute the corresponding function, and return its exports .
You could theoretically require talk about the package, but it will just return an empty object (although it can ruin global variables). And, in all likelihood, this can break down because the related modules believe that they are executed in the browser. It will not do any good.
The only normal option, if you want to stick with the host, is to copy the node_modules folder from your local project folder. This may not work if your computer and server are not 100% compatible (e.g. 32-bit with 64-bit, Debian vs RedHat, OSX / Windows and Linux), but it mostly depends on your exact dependencies (mostly everything built with node-gyp can be a problem).
Node.js uses the node_modules folder when automatically looking for dependencies in require . If you can somehow get the node_modules folder with the correct contents on the server, require("foo") will work as long as node_modules contains the foo module.
source share