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

pipe atlassian/ssh-run:0.4.3 return error when running npm run build

anhtruc92cr
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 27, 2024

Hello,

 

My pipeline return error on ssh-run step:

pipeline-error1.png

YML file: 

image: node:latest

definitions:

  steps:

    - step: &build-test

        name: Build and test

        caches:

          - node

        script:

          - npm install

          - npm run build

        artifacts:

          - .next/**

    - step: &deploy

        name: Deploy artifacts using SCP to PROD

        script:

          - &deploy-script

            pipe: atlassian/scp-deploy:0.3.3

            variables: &deploy-variables

              USER: $USER

              SERVER: $SERVER

              REMOTE_PATH: '/var/www/html/'

              LOCAL_PATH: '${BITBUCKET_CLONE_DIR}/*'

          - &ssh-script

            pipe: atlassian/ssh-run:0.4.3

            variables: &ssh-variables

              SSH_USER: $USER

              SERVER: $SERVER

              COMMAND: 'cd /var/www/html && npm install && npm run build && npm run start'

pipelines:

  branches:

    develop:

      - step:

          <<: *build-test

          name: Build and test on develop

      - step:

          <<: *deploy

    production:

      - step:

          <<: *build-test

          name: Build and test on production

      - step:

          <<: *deploy

          deployment: production

          script:

              - <<: *deploy-script

                variables:

                    <<: *deploy-variables

                    SERVER: $SERVER_PRODUCTION

              - <<: *ssh-script

                variables:

                    <<: *ssh-variables

                    SERVER: $SERVER_PRODUCTION

 

Thank you in advance for any assistance!

1 answer

1 vote
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 1, 2024

Hi @anhtruc92cr 

The error does not appear to relate to Pipelines, that error is NPM specific and mentions the picocolors dependency, essentially the error means that the parser cannot interpret the code as there is an issue with the command syntax.

As you are using the latest node image, I'd suggest downgrading to a previous node version (if these commands were working in the past), or updating your version of the picocolors dependency.

Cheers!

- Ben (Bitbucket Cloud Support)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events