OutOfMemoryException installing multiple dependencies

I have an internal package that has a total of 19 cascading dependencies, some of them internal, some external. Trying to install this package into a project using the Visual Studio Package Manager is throwing an OutOfMemoryException after resolving and
installing all of the dependencies. I previously got the same exception while installing the same package into a different project; I was able to resolve that by restarting Visual Studio and trying again. This time, restarting Visual Studio and even the machine
doesn't help. The crazy thing is that because this package has already been installed in another project, all of the dependencies have already been installed in the solution. So after resolving all of the dependencies and verifying that they are installed,
all that is left to do is add the appropriate references to the project and the local packages.config. But somehow that is resulting in an OutOfMemoryException.