Forge Bitbucket pipeline error

Hi there,

today, I wanted to try out creating a Bitbucket Pipeline to deploy our Forge App via Bitbucket.
I used this Repository as a guide: Bitbucket

My pipeline always fails in the “npm install” step, with the following error:

SyntaxError: Unexpected token .
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/opt/atlassian/pipelines/agent/build/node_modules/@forge/cli/node_modules/launchdarkly-js-sdk-common/src/index.js:17:46)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

Am i doing something wrong? Or is this a error in the “@forge/cli” package?

Thanks in advance,

Regards
Adrian

Hi Adrian,

It looks like the CLI is trying to be installed in an incompatible version of node.

I see the example repo is out of date and using node:10.16.3, if you’ve copied that could you try again with node:16.

I’ll get the example updated in the meantime.

Kind Regards
Owen

1 Like

Hi Owen,

thanks for the reply. Yes, the node version was one of the Problems. But the example repo is just very old. Many aspects (for example, the forge login) don’t work like they used to. I found this documentation https://developer.atlassian.com/platform/forge/set-up-cicd/ which seems up-to-date. And helped me to get my pipeline up and running. Since I didn’t find this documentation, but the Bitbucket repository via a simple google search, just remove the repo or refer to the documentation in the README. It is very confusing to have multiple documentation and examples that are no longer edited or referenced.

Regards
Adrian

1 Like

Correct it and submit a pull request? :wink: