This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have travis cache the npm cache instead of node_modules.
- Loading branch information
85ad21b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jdalton what exactly is the benefit of this change? I've seen several projects now doing this, and consequently have asked why on Stack Overflow - http:https://stackoverflow.com/q/42521884/130638
85ad21b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@balupton Hi!
I noticed caching the node_modules folder caused problems (build fails) while caching the
.npm
cache avoided it. I believe it's because the.npm
cache doesn't store compiled native modules while thenode_modules
folder does. So when you test different versions of Node, as is common in Travis-CI, it will try to load a native module compiled for say Node 4 in Node 6 and barf.85ad21b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdalton okay that makes sense. Want to add that to the SO question, and I'll mark it as the answer - thanks so much!