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

Pipelines npm not found

Sean Dean April 22, 2022

I'm trying to run a pipeline that runs an npm build, but I keep getting an `npm not found` error. Here is my bitbucket-pipelines.yml file (please excuse the formatting)

image: node:14.16.0

pipelines:
tags:
'*.*.*':
- step :
name : "Build"
deployment: production
script :
- npm install
- npm run build
artifacts:
- dist/**
- step:
name: RSYNC To Server
script:
- pipe: atlassian/rsync-deploy:0.7.1
variables:
USER: $SSH_USER
SERVER: $SSH_IP
REMOTE_PATH: $PATH
LOCAL_PATH: './dist'
DEBUG: 'true'
EXTRA_ARGS: '-avzq --delete --links --exclude-from=rsync_exclude.txt'
 

 

Here is the log file, if it helps. 

+ umask 000

+ GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="main" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR
Cloning into '/opt/atlassian/pipelines/agent/build'...

+ git reset --hard 7ed763c53d5f5de117d3b6297b6eaaa9204b5d5c
HEAD is now at 7ed763c try atlassian default

+ git config user.name bitbucket-pipelines

+ git config user.email commits-noreply@bitbucket.org

+ git config push.default current

+ git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://localhost:29418/

+ git remote set-url origin http://bitbucket.org/$BITBUCKET_REPO_FULL_NAME

+ git reflog expire --expire=all --all

+ echo ".bitbucket/pipelines/generated" >> .git/info/exclude

+ chmod 777 $BUILD_DIR

Images used:
build : docker.io/atlassian/default-image@sha256:edf4bd880adf9e7f7677094f7a1d944524c7f98e939550bc152523c5cf6080ff
bash: lesspipe: command not found
bash: dircolors: command not found
+ npm install
bash: npm: command not found
bash: lesspipe: command not found
bash: dircolors: command not found
Searching for files matching artifact pattern dist/**

Searching for test report files in directories named [test-results, failsafe-reports, test-reports, TestResults, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.

I've run it through the pipelines validator and it passes as valid. I'm not sure what I'm missing or if something is going wrong in the pipeline itself. Thanks for any help you can provide.  

1 answer

1 accepted

0 votes
Answer accepted
Sean Dean April 22, 2022

Ugh. I found the issue. I had an ENV VAR named PATH, which broke everything.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events