Strider-CD / strider-node

Run Node.js tests in strider
11 stars 13 forks source link

node_modules not getting cached #6

Closed johnmarkg closed 10 years ago

johnmarkg commented 10 years ago

I was having a hard time getting node_modules cached and found that updateCache was never getting called from the installPackages callback:

installPackages(context, context.cachier('modules'), context.dataDir, config.caching, config.update_cache, function (err, exact) {
    if (err || exact || nocache) return next(err)
    updateCache(context, context.cachier('modules'), context.dataDir, next)
})

I logged the value of exact and found out it to be the output of the npm install. exact is set true when the package.json hashes match

Changing if (err || exact || nocache) return next(err) to if (err || exact === true || nocache) return next(err) fixed it for me.

jaredly commented 10 years ago

Just to confirm => you had enabled caching via the config page?

johnmarkg commented 10 years ago

Yes, I tried strict and loose.

jaredly commented 10 years ago

ok, great; thanks!