Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

node_modules cache #747

Open
benrolfe opened this issue Jun 6, 2017 · 2 comments
Open

node_modules cache #747

benrolfe opened this issue Jun 6, 2017 · 2 comments

Comments

@benrolfe
Copy link

benrolfe commented Jun 6, 2017

Is there a way to cache the node_modules folder? It's taking several minutes to install all the node packages on each deploy.

@benrolfe
Copy link
Author

benrolfe commented Jun 8, 2017

Any help @Anahkiasen?

@Anahkiasen
Copy link
Member

Anahkiasen commented Jun 8, 2017

In Rocketeer 2 there is no special mechanism in place for this (there is in Rocketeer 3 but it is not out yet). You however have several solutions at hand:

  1. Place node_modules in your shared folders so that it is reused between releases. This however makes rollbacks more difficult so it is to keep in mind
  2. Copy the node_modules from the previous release in a before hook, if it exists

Finally before doing this you can solve the issue at the package manager level – ie. look into why it is taking several minutes in the first place. Maybe give a shot at either Yarn or NPM5 which both provide faster installation times for Node dependencies. There are also some wrappers around NPM like npm-cache and stuff, older versions of NPM were notably slow so you should find things pretty easily on the web

I'd recommend to do this first because even if you can make it fast for deployments you're really just working around the problem and it will still be slow for you locally and for every first deployment on a new server, and so on.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants