Hello.
I have the following files:
bitbucket-pipelines.yml
Ubuntu Pastebin
package.json
package.lock.json
When I try to run the pipeline, I get this error:
Please suggest how to resolve this.
I tried several different images, but its not working.
Thank you for your time.
Hi @Syed Shams Elahi
Each step is runs on a separated docker container. You can solve this by installing deps and running within the same step, or referencing the cache on every step you want to use it. You reference it in same way you did in the first step.
Hello.Thank you for your response. Can you please show me an example or help guide me to update mine?
Sure:
image: mcr.microsoft.com/playwright:v1.49.0-noble pipelines: default: - step: name: Install dependencies caches: - node script: - npm ci - npx playwright install-deps - npx playwright install - step: name: Run Playwright tests #### Reference the cache here caches: - node script: - npx playwright test
Hi @Syed Shams Elahi and welcome to the community!
I would actually recommend combining the two steps into one, instead of keeping two separate steps and referencing the cache in both steps.
Caches are temporary, so your builds should be configured to work whether or not the cache is present. Any cache which is older than 1 week will be cleared automatically and repopulated during the next build. Additionally, users can manually remove a cache from the Pipelines page of a repo. So, if a cache expires or if it is manually removed by someone right before the second step runs, then your build will fail.
You can combine both steps into one as follows:
image: mcr.microsoft.com/playwright:v1.49.0-noblepipelines: default: - step: name: Install dependencies and Run Playwright tests caches: - node script: - npm ci - npx playwright install-deps - npx playwright install - npx playwright test
Kind regards,Theodora
It looks like you're new here. Sign in or register to get started.