Codeceptjs not able to find step_definition & pages files

Hi ,
I am facing this issue recently with codeceptJS ,
on executing the “npx codeceptjs run -c codecept.conf.js” command I am getting this issue :

Could not include object Step Definition from /home/nikhitakale/Desktop/UI Auto/qa/ui-automation-qa/search-service/web_step_definitions/search_step.js from module '/home/nikhitakale/Desktop/UI Auto/qa/ui-automation-qa/search-service/web_step_definitions/search_step.js'
Cannot find module './search-service/pages/searchPage.js'
Require stack:
- /home/nikhitakale/Desktop/UI Auto/qa/ui-automation-qa/search-service/web_step_definitions/search_step.js
- /home/nikhitakale/Desktop/UI Auto/qa/ui-automation-qa/node_modules/codeceptjs/lib/container.js
- /home/nikhitakale/Desktop/UI Auto/qa/ui-automation-qa/node_modules/codeceptjs/lib/codecept.js
- /home/nikhitakale/Desktop/UI Auto/qa/ui-automation-qa/node_modules/codeceptjs/bin/codecept.js

Package.json :

 "devDependencies": {
    "@wdio/sync": "^6.4.0",
    "@wdio/cli": "6.3.6", 
    "@wdio/selenium-standalone-service": "^6.1.14",
    "allure-commandline": "^2.13.0",
    "codeceptjs": "^2.6.11",
    "codeceptjs-dbhelper": "^1.0.0",
    "database-js-mysql": "^1.1.3",
    "eslint": "^6.7.2",
    "eslint-plugin-codeceptjs": "^1.2.0",
    "nodemailer": "^6.4.2",
    "protractor": "^5.4.2",
    "webdriverio": "^6.1.23"
  },
  "dependencies": {
    "chai": "^4.2.0",
    "chai-http": "^4.3.0",
    "dotenv": "^8.2.0",
    "glob": "^7.1.6",
    "mocha": "^7.1.2",
    "node-fetch": "^2.6.1",
    "fs-extra": "^9.0.1",
    "querystring": "^0.2.0"
  }
} 

Please help

1 Like

I see your config file stays in the root folder, so you just run npx codeceptjs run should be enough, thou!

Thanks for the quick response @peterngtr,but no luck with it either

This issue has been resolved after downgrading the node version < 13 as per the given information on webdriverIO’s official website : https://webdriver.io/docs/docs/wdio-json-reporter.html#wdio-version-compatibility

1 Like