node.js - 找不到模块:错误:无法解析“cypress-react-selector”
问题描述
我正在尝试使用@cypress/react并按照安装说明进行操作。此外,我还安装了赛普拉斯测试库以使用赛普拉斯的测试库扩展。
启动柏树时,我收到以下错误消息:
./node_modules/@cypress/react/support/index.js
Module not found: Error: Can't resolve 'cypress-react-selector' in '/home/developer/project/example/webapp/board-ui/node_modules/@cypress/react/support'
resolve 'cypress-react-selector' in '/home/developer/project/example/webapp/board-ui/node_modules/@cypress/react/support'
Parsed request is a module
using description file: /home/developer/project/example/webapp/board-ui/node_modules/@cypress/react/package.json (relative path: ./support)
Field 'browser' doesn't contain a valid alias configuration
Looked for and couldn't find the file at the following paths:
[/home/developer/project/example/webapp/board-ui/node_modules/@cypress/react/support/node_modules]
[/home/developer/project/example/webapp/board-ui/node_modules/@cypress/node_modules]
我必须安装 cypress-react-selector 吗?
解决方案
您可以只安装缺少的包cypress-react-selector。
npm i --save cypress-react-selector
我不确定它是否应该与@cypress/react 或 Cypress 测试库一起安装,如果是这样,那么值得重新安装它们并在安装过程中注意错误消息。
推荐阅读
- python - Python:将索引的数据类型从对象更改为日期时间会删除时间(HH:MM:SS)
- android - Kotlin 从 Fragment 访问资产以设置字体
- javascript - 查找包含转义形式的分隔符的子字符串 (Regexp)
- wpf - WPF 在不同的窗口中使用相同的面板
- visual-studio-code - Visual Studio Code - Exploration 和 Visual Studio Code 之间的主要区别是什么?
- solr - Solr - 强制方面显示当前不存在于任何文档中的枚举字段
- xamarin.forms - Xamarin 表单:相机和图库在 android 中不起作用,显示权限异常
- c - Valgrind 报告 libgc 错误
- angular - 测试无效表单时不显示角度错误文本
- python - catalan() 函数在这里如何工作?