A solution is to use project specific .npmrc file with cache property set to e.g. .build-tmp/npm-cache.
cache = ".build-tmp/npm-cache"