Build error in pipeline : Cannot find module 'ajv/dist/compile/codegen'

Hi Team,

We’re facing this build error in the bitbucket pipeline while we’re trying to build cumulocity web application. Can anyone please help us resolve this?

Build failed
Error: Cannot find module ‘ajv/dist/compile/codegen’
Require stack:

  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/node_modules/ajv-keywords/dist/definitions/typeof.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/node_modules/ajv-keywords/dist/keywords/typeof.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/node_modules/ajv-keywords/dist/keywords/index.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/node_modules/ajv-keywords/dist/index.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/node_modules/schema-utils/dist/validate.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/node_modules/schema-utils/dist/index.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/node_modules/mini-css-extract-plugin/dist/index.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/dist/webpack/config/styles.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/dist/webpack/config/index.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/dist/webpack/Application.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/dist/webpack/index.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/dist/cli/ServerCommand.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/dist/cli/CumulocityCommandLine.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/dist/cli.js
  • /opt/atlassian/pipelines/agent/build/node_modules/@c8y/cli/cli.js

I’m assuming you are using a wrong node version running Cumulocity IoT 10.18 - > Angular 14?

According to this Angular you should only use

Node version ^14.15.0 || ^16.10.0

Can you confirm you are using the correct version in your pipeline?

Our Cumulocity IoT is 10.17 and Node version is 14.21.3

Hi @sandeep.viswanatha

can you elaborate a bit more? Was your pipline working beforehand or are you just setting it up now?
If it was working beforehand what have you changed since it was working the last time?
Is the build working if you execute the same steps on your local machine?

Can you provide your package.json file and all the commands that you are executing as part of your pipeline?

Regards,
Tristan

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.