Closed JustinBeckwith closed 8 years ago
Was this installation done on npm@2 or 3?
Definitely a known issue, and will be fixed as best we can: https://github.com/GoogleCloudPlatform/google-cloud-node/issues/1590#issuecomment-249573895
Related: #1535, #1590, #1605
This was node 6.6.0 and npm 3.10.3
We should see improvements for npm@3 users during installation after we synchronize the version of @google-cloud/common
each sub-module depends on. It's @google-cloud/common
's dependency on grpc
that requires a large installation/compilation time.
We expect to sync those versions and release today, and hopefully, we'll see a big drop.
For npm@2 users, they'll likely see the same installation speeds, but will have faster start-up times and lower disk space usage if they manually run npm dedupe
after installing. @JustinBeckwith had the idea of running npm dedupe
from google-cloud
's postinstall
script-- any thoughts on that? // @callmehiphop @sindresorhus @passy
Also just stumbled upon:
The new Node.js v6 branch will become the new Active Long Term Support stream in October...
We're almost there, which will mean node@6 and npm@3 is the LTS branch. GAE can upgrade at that point / Docker images, etc, which should help with this issue.
Node.js v4.x
LTS is going to be supported until 2018-04-01, and a significant number of users are expected to continue using v4.x
even after v6.x
goes into Active LTS. I think this issue needs to be addressed regardless.
Agreed. Just noting we can expect less users to experience this once node@6 goes LTS. Will the GAE Flexible Environment VM update its Node image in October to v6?
Looks like there is a bit of a precedent for npm dedupe
-ing from the postinstall script: https://github.com/search?q=%22postinstall%22%3A+%22npm+dedupe%22&type=Code&utf8=%E2%9C%93
I'm okay with this plan if the others are.
After publishing v0.41.0 with flattened gRPC dependencies:
npm cache clean time npm install --save google-cloud 24.23s user 8.09s system 50% cpu 1:04.41 total
Not an amazing improvement, but it's ~20 seconds quicker here. I've tested a bit more since this post and have seen it around ~47 seconds total.
The next step for improvement will be upgrading google-gax's grpc dependency to 1.0.0 to match ours, allowing for npm to flatten our tree further. (Issue opened here, PR to follow)
Seeing better results now with google-cloud@0.41.2 which uses npm shrinkwrap to force the deduplication for users on npm < 3.
$ time npm install --save google-cloud
34.22s user 14.73s system 131% cpu 37.264 total
Installation of the
google-cloud
npm module has gotten just a little slow. I just ran this on OSX, and it took 83 seconds to complete. That's waaaaay too slow.