Hello.
I have the following files:
bitbucket-pipelines.yml
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 @SSE 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-noble
pipelines:
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
Hi @SSE
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello.
Thank you for your response.
Can you please show me an example or help guide me to update mine?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.