Error: Cannot find module 'cypress-xpath' from 'D:\Automation Code\Cypress\cypress-ui-automation\cypress\support' at D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:46:17 at process (D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43) at ondir (D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)
Asked
Active
Viewed 560 times
2 Answers
2
It looks like you have missed the install of cypress-xpath
.
If you are installing with npm:
npm install -D cypress-xpath
or if you are installing with yarn:
yarn add cypress-xpath --dev
You clearly already have the the require statement in \cypress\support
since that is the first path in the error stack.

TesterDick
- 3,830
- 5
- 18
1
Assuming that the cypress-xpath plugin is already installed, Under cypress/support/e2e.js
you have to add this:
require('cypress-xpath');

Alapan Das
- 17,144
- 3
- 29
- 52