It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Pipelines: cache custom node_modules folder

Nurbol Alpysbayev Apr 11, 2018

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/)? 

1 answer

1 accepted

2 votes
Answer accepted
Nurbol Alpysbayev Apr 11, 2018

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

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,856 views 1 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you