node.js - 未找到命令:排毒
问题描述
我正在尝试将 detox e2e 测试添加到我的项目中。我浏览了它的文档,但是,我无法在我的机器上安装它。这是我的 devDependencies:
"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-env": "^7.12.7",
"@babel/preset-flow": "^7.12.1",
"@babel/preset-react": "^7.12.7",
"@babel/runtime": "^7.4.5",
"@testing-library/jest-native": "^3.4.3",
"@testing-library/react-native": "^7.1.0",
"@types/react-native-sqlite-storage": "^3.3.1",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.8.0",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-transform-remove-console": "^6.9.4",
"detox": "^17.14.3",
"jest": "^24.9.0",
"jest-circus": "^26.6.3",
"metro-react-native-babel-preset": "^0.54.1",
"prettier": "^1.18.2",
"react-test-renderer": "16.8.3"
}
另外,我有installed npm install -g detox-cli
,但我有command not found: detox
node : 10.22.1
os: Catalina
react-native: 0.61.2
解决方案
我希望现在您已经找到了答案,但是对于其他有同样问题的开发人员,我的答案如下
1st 确保安装 detox CLI 不仅可以在您的项目中添加 detox,还可以使用:npm install -g detox-cli
第二,如果您使用 Expo CLI 而不是 react-native cli,这将是一个问题,因为对 Detox 的 Expo 支持完全是社区驱动的工作。我们在 Detox for Expo 应用程序中没有具体的支持。
如果您发现问题,很可能不是 Detox 本身的问题,而是 Expo 运行时或不正确的 Detox 设置问题。有关如何在 Expo 中使用 Detox 的支持,您应该联系 Expo 团队或 Expo 社区。
推荐阅读
- ms-access - MS Access 组合框显示选项卡
- html - SVG 光标有不需要的灰色边缘
- android - 将 ImageButton 放在两个视图组之间
- amazon-web-services - 权限有助于设置用户对 S3 的访问权限
- javascript - IIFE:如果我返回警报而不将其包装在函数中,为什么我的代码会忽略 addEventListener?
- keras - 使用 Keras 添加和访问辅助 tf.Dataset 属性
- java - Java 流操作调用
- c# - 当我有该类的多个实例时,如何获取该类的索引/事件?
- r - R:生成针对特定玩家的赢/输记录表
- bash - 当管道到 xxd 时,为什么有些文本未经修改就通过了?