问题描述
我在 OsX 上,使用 nvm,节点 10.15.3.Testscafe (not live) 工作正常,但我试图按照 Testcafe-live 上的说明进行操作
I am on OsX, using nvm, node 10.15.3.Testscafe (not live) works fine, but I was trying to follow the instructions at Testcafe-live
在它解释如何在本地安装它的步骤中
At the step where it explains how to install it locally
如果您已将 testcafe-live 本地安装到您的项目中,请添加npm 脚本到 package.json 以运行测试:
它指的是一个package.json文件,我在脚本部分添加了条目
it refers to a package.json file, I added the entry under the scripts section
"scripts": {
"test": "eslint ./**/*.js",
"testcafe-live": "testcafe-live chrome tests/"
},
但是当我运行时
npm run testcafe-live
我收到以下错误:
npm ERR! path /Users/Thomas.Pavan/testcafe/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/Thomas.Pavan/testcafe/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Thomas.Pavan/.npm/_logs/2019-03-11T14_58_28_946Z-debug.log
我看到 package.json 路径是问题所在,我的 package.json 文件位于 ~/testcafe/node_modules/testcafe-live 但 npm 正在查看/Users/Thomas.Pavan/testcafe/.如果我将 testcafe-live 安装在错误的位置(当前位于 ~/testcafe)我的项目根文件夹中,我会感到困惑,而且我也不明白在哪里可以更改错误中显示的路径.长话短说,package.json 文件应该在我的文件夹的根目录中,但按照说明安装 testcafe-live,会创建一个 node_modules 文件夹,并且 package.json 文件嵌套在那里.
I see that the package.json path is the problem, my package.json file is in ~/testcafe/node_modules/testcafe-live but npm is looking at /Users/Thomas.Pavan/testcafe/.I'm confused if I installed testcafe-live in the wrong location (currently at ~/testcafe) my project root folder, and I also don't understand where I can change the path shown in the error.Long story short, the package.json file should be in the root of my folder but installing testcafe-live as instructed, creates a node_modules folder and the package.json file is nested there.
推荐答案
感谢您对TestCafe 的关注.从 1.0.0 版开始,TestCafe 具有内置的实时模式功能,并且不需要任何外部模块.您提到的存储库现在已过时.请参阅以下文章以获取更多详细信息 https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/live-mode.html
Thank you for your interest in TestCafe.Starting from version 1.0.0 TestCafe has a built-in Live mode feature and it does not require any external module. The repository you mentioned is obsolete now.Please refer to the following article to get more details https://devexpress.github.io/testcafe/documentation/using-testcafe/common-concepts/live-mode.html
这篇关于Testcafe live 没有运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!