if i ran the "npm build " in the first step. It's working fine. but if i split the "npm run" to the next step it's failing and seeing the below error:
Error Block :
> xdex-ui@0.0.0 build /opt/atlassian/pipelines/agent/build
> ng build
Node.js version v4.2.1 detected.
The Angular CLI requires a minimum Node.js version of either v10.13 or v12.0.
Please update your Node.js version or visit https://nodejs.org/ for additional instructions.
npm ERR! Linux 5.13.0-1017-azure
npm ERR! argv "/bin/versions/node/v4.2.1/bin/node" "/bin/versions/node/v4.2.1/bin/npm" "run" "build" "--configuration=dev" "--optimization=false"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! xdex-ui@0.0.0 build: `ng build`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the xdex-ui@0.0.0 build script 'ng build'.
npm ERR! This is most likely a problem with the xdex-ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ng build
npm ERR! You can get their info via:
npm ERR! npm owner ls xdex-ui
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /opt/atlassian/pipelines/agent/build/npm-debug.log
My pipeline.yml
pipelines: branches: feature/cicd-test: - step: name: install image: node:14.17.1 caches: - node script: - npm install artifacts: - node_modules/** - step: name: deploy deployment: Dev trigger: manual script: - npm run build ## environment specific - python3 deploy.py
please advise.
Hi @Chanakya and welcome to the community.
For every step of your bitbucket-pipelines.yml file, a Docker container starts, the repo gets cloned, the commands of that step's script are executed, and then the container gets destroyed.
For the first step, you have defined an image, node:14.17.1. However, since no image is defined for the second step, the second step will use atlassian/default-image:latest as a build container that has an older version of node.
What you can do is either add image: node:14.17.1 in the definition of the second step as well, or add it at the top of your bitbucket-pipelines.yml file.
If you add it at the top of the yml file as follows:
image: node:14.17.1
pipelines:
branches:
feature/cicd-test:
[...]
then all the steps of your bitbucket-pipelines.yml file will use that image as a build container.
Kind regards,
Theodora
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.