[英]Getting below error whenever I try to run Cypress Suite
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)错误:在 D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve 的“D:\Automation Code\Cypress\cypress-ui-automation\cypress\support”中找不到模块“cypress-xpath” \node_modules\resolve\lib\async.js:46:17 在进程(D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:173:43 ) 在 ondir (D:\Automation Code\Cypress\cypress-ui-automation\node_modules\browser-resolve\node_modules\resolve\lib\async.js:188:17)
It looks like you have missed the install of cypress-xpath
.看起来您错过了
cypress-xpath
的安装。
If you are installing with npm:如果您使用 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.您显然已经在
\cypress\support
中有 require 语句,因为这是错误堆栈中的第一条路径。
Assuming that the cypress-xpath plugin is already installed, Under cypress/support/e2e.js
you have to add this:假设已经安装了cypress-xpath插件,在
cypress/support/e2e.js
你必须添加这个:
require('cypress-xpath');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.