Closed alexfernandez closed 11 years ago
Hi, I'm confused as to why this makes your deployment process slow.
Are you running "npm install protobuf" more than once on each machine? If so, why do you need to do this?
Perhaps I haven't understood the issue here?
We need to run "npm install protobuf" multiple times on each machine, because our deployment process makes sure that all packages are installed before proceeding. It is quite convenient for us to have a single script that installs all npm dependencies, so that it is idempotent and it runs the same on new and on old machines.
This setup works well with all packages except for protobuf, which is compiled every time.
The current build system was contributed by @seishun - perhaps you could ask him whether he know why it recompiles on each install?
Unfortunately for most users this is likely to be an irrelevant issue - though I do see why it is annoying for you. Perhaps you could create and contribute a fix?
P.S. Build system was contributed here: https://github.com/chrisdew/protobuf/commit/a1205e7edbb1583864b331bcef58b4119e2d814a
Note: this page is huge and takes a minute or two to load on 10MBit broadband.
We already have a workaround in place: one script to install and another to update. It is a bit annoying, and the issue is likely to bite others in the future, but my current knowledge of the npm build system is more likely to cause damage than to solve anything. At least now the issue is documented.
@alexfernandez What are your install scripts doing that the normal npm process doesn't. If I have a package that depends on protobuf I just put '"protobuf" : "~0.8.6" in dependencies object in package.json. Then run npm install
, it will compile protobuf and download any other needed packages, any npm install
calls later skip the compiling and installation of the already installed package.
@AdamMagaluk that is not our use case. Just run "npm install protobuf" from the command line. The output will look like:
$ npm install protobuf
npm http GET https://registry.npmjs.org/protobuf
npm http 304 https://registry.npmjs.org/protobuf
> protobuf@0.8.6 install /.../node_modules/protobuf
> node-gyp rebuild
and it will recompile all native code in the package every time.
On second inspection, apparently all native modules are recompiled every time, it is just that protobuf takes much, much longer than the rest. Closing issue. Thanks for your time!
Every time I run "npm install protobuf" it is recompiled. This does not happen with other packages, even those with native code. It makes our deployment process very slow. On Mac OS X, Ubuntu and Debian.