Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,211
Community Members
 
Community Events
176
Community Groups

ng build is error after using the artifacts

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. 

1 answer

1 accepted

0 votes
Answer accepted

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

Thanks Theodora,  it worked. after using the image: in second step. 

Also, my command is incorrect. 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events