Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipe error when build test

sc
Contributor
June 4, 2019

Dear all,

I am just trying to see and learn how to use BitBucket. I am able to push file and updated branch like any normal version control system.

Then I try to see how to use Pipe for CI/CD.
In my master branch I have a simple text readme file as a sample

Then when my pipe start it say it cannot find some files :

here is below steps from BUILD action :
+ umask 000+ GIT_LFS_SKIP_SMUDGE=1 git clone --branch="master" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIRCloning into '/opt/atlassian/pipelines/agent/build'...+ git reset --hard 56ea34fbbf3f7006faf8add69afcaf451c6783b2HEAD is now at 56ea34f Initial Bitbucket Pipelines configuration+ 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+ echo ".bitbucket/pipelines/generated" >> .git/info/exclude+ chmod 777 $BUILD_DIRCache "node": DownloadingCache "node": Not found

 

Here is below steps from Npm install:
+ npm installnpm WARN saveError ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/package.json'npm notice created a lockfile as package-lock.json. You should commit this file.npm WARN enoent ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/package.json'npm WARN build No descriptionnpm WARN build No repository field.npm WARN build No README datanpm WARN build No license field.up to date in 0.365sfound 0 vulnerabilities

Here is below steps from Npm test: (test is my repo)

+ npm testnpm ERR! path /opt/atlassian/pipelines/agent/build/package.jsonnpm ERR! code ENOENTnpm ERR! errno -2npm ERR! syscall opennpm ERR! enoent ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/package.json'npm ERR! enoent This is related to npm not being able to find a file.npm ERR! enoent npm ERR! A complete log of this run can be found in:npm ERR! /root/.npm/_logs/2019-06-04T09_58_58_110Z-debug.log

 

What should I do to make it work ?
As I am new to this please describe clearly what to do

Thnaks for help

1 answer

1 accepted

0 votes
Answer accepted
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 11, 2019

Hello,

Right now you're using NPM in your bitbucket-pipelines.yml. Do you have an NPM project (you mention you just have a text file in your repository at the moment). NPM is a build tool that looks for a package.json file to get additional information for executing commands. It's typically used for Node.js and Javascript projects. If you're using NPM, which directory is your package.json file in?

If you're not using NPM, what kind of project are you making? i.e. What programming language?

If you've only got the text file in your repository, and are just trying to get a green build that does nothing. Then you can remove the npm commands and just do something like this in your bitbucket-pipelines.yml:

pipelines:
default:
- step:
script:
- echo "Hello world!"

From there you can build more advanced scripts as you start adding code to your project. You can find guides for specific programming languages here: https://confluence.atlassian.com/bitbucket/language-guides-856821477.html

Thanks,

Phil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events