13

I'm trying to setup my first Bitbucket pipeline which simply builds my application and deploys it to my FTP server using the following bitbucket-pipelines.yml

image: node:6.9.4

pipelines:
  default:
    - step:
        caches:
          - node
        script:
          - npm install
          - npm test
    - step:
        script:
          - npm run build
          - node deploy.js

The issue lies in the npm install because when bitbucket tries to run the npm run build command it says that rimraf (a npm package) is not found. rimraf however is listed in my devDependencies, all regular dependencies in my package.json are downloaded correctly.

There is no global variable set by my so the NODE_ENV could not be it right?

NealVDV
  • 2,302
  • 3
  • 26
  • 51

2 Answers2

1

I had this same issue. For me, the problem was that the version of Node on my local development device was different from the version of Node in the bitbucket-pipelines.yml file.

To fix it, I went into bitbucket-pipelines.yml and changed this line:

image: node:10.15.3

to this:

image: node:14.15.0
Captain Delano
  • 427
  • 1
  • 4
  • 12
0

I had the same issue with gulp.

Gulp was in devDependencies and also specified in package.json as script but still it said npm ERR! missing script: gulp

The documentation says to install it globally, so there might be a related issue with your package.

https://confluence.atlassian.com/bitbucket/javascript-node-js-with-bitbucket-pipelines-873891287.html

Rich Steinmetz
  • 1,020
  • 13
  • 28