Closed johnmarkg closed 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:
updateCache
installPackages
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
exact
npm install
true
package.json
Changing if (err || exact || nocache) return next(err) to if (err || exact === true || nocache) return next(err) fixed it for me.
if (err || exact || nocache) return next(err)
if (err || exact === true || nocache) return next(err)
Just to confirm => you had enabled caching via the config page?
Yes, I tried strict and loose.
ok, great; thanks!
I was having a hard time getting node_modules cached and found that
updateCache
was never getting called from theinstallPackages
callback:I logged the value of
exact
and found out it to be the output of thenpm install
.exact
is settrue
when thepackage.json
hashes matchChanging
if (err || exact || nocache) return next(err)
toif (err || exact === true || nocache) return next(err)
fixed it for me.