Do I understand correctly that pre-defined `node` cache only works when node_modules and package.json are located in the root directory of a project? Then how do I configure bitbucket-pipelines.yml to make cache work with node_modules folder located in subfolder (./public/node_modules/)?
Managed to solve it
with:
...- step caches: - node-custom script: - if [ ! -d "node_modules" ]; then npm install; fi...definitions: caches: node-custom: public/node_modules
Will that not cause problems if package.json is updated as the node_modules won't be re-generated once cached?
It will. You need to manually delete your cached dependencies using the UI.
There sure must be a way how to delete it automatically when package-lock.json changes?
It looks like you're new here. Sign in or register to get started.