Repository navigation
npm install google-cloud takes 83 seconds. #1627
Description
Activity
Was this installation done on npm@2 or 3?
Definitely a known issue, and will be fixed as best we can: #1590 (comment)
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/commoneach sub-module depends on. It's@google-cloud/common's dependency ongrpcthat 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 dedupeafter installing. @JustinBeckwith had the idea of runningnpm dedupefromgoogle-cloud'spostinstallscript-- any thoughts on that? // @callmehiphop @sindresorhus @passyAlso 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.xLTS is going to be supported until 2018-04-01, and a significant number of users are expected to continue usingv4.xeven afterv6.xgoes 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%93I'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 totalNot 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 [email protected] 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- added a commit that references this issue
on Jul 23, 2025 - added a commit that references this issue
on Mar 18, 2026 - added 2 commits that reference this issue
on Mar 23, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
Installation of the
google-cloudnpm 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.Details