You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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 :
> email@example.com 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! firstname.lastname@example.org build: `ng build`
npm ERR! Exit status 3
npm ERR! Failed at the email@example.com 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
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
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:
then all the steps of your bitbucket-pipelines.yml file will use that image as a build container.