node.js - Windows 上的 TestCafe 失败,并出现 spawn powershell.exe ENOENT 错误

标签 node.js powershell testing automated-tests testcafe

我尝试在 Windows10 上运行 TestCafe 以进行评估,但按照说明安装后 https://devexpress.github.io/testcafe/documentation/using-testcafe/installing-testcafe.html#local-installation当使用使用浏览器作为选项的选项运行 testcafe 时,我总是收到以下错误,即除 testcafe -htestcafe -v 之外的任何内容。

ERROR Error: Command failed with ENOENT: powershell.exe -NoLogo -NonInteractive -Command "$cp = (chcp | Select-String '\\d+').Matches.Value; Try { chcp 65001; Get-Item 'Registry::HKEY_LOCAL_MACHINE\Software\Clients\StartMenuInternet\*\shell\open\command'|Get-ItemProperty -Name '(default)'|Format-List -Property '(default)','PSPath'|Out-String -Width 2147483647|Write-Host; } Finally { chcp $cp; }"
spawn powershell.exe ENOENT
    at notFoundError (C:\Users\xxx\AppData\Roaming\npm\node_modules\testcafe\node_modules\cross-spawn\lib\enoent.js:6:26)
    at verifyENOENT (C:\Users\xxx\AppData\Roaming\npm\node_modules\testcafe\node_modules\cross-spawn\lib\enoent.js:40:16)
    at ChildProcess.cp.emit (C:\Users\xxx\AppData\Roaming\npm\node_modules\testcafe\node_modules\cross-spawn\lib\enoent.js:27:25)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

操作系统版本:Windows 10.0.18363

Node 版本:v13.6.0(64位),但我也尝试了各种其他版本和32位

npm 版本:6.13.6

testcafe版本:1.7.1

我使用的其他 Node 应用程序都没有出现任何问题,只有这个。如果有人可以帮助我找到问题以及如何解决它,那就太好了。

最佳答案

此问题已在 https://github.com/DevExpress/testcafe-browser-tools/commit/7e8baac47ec4279e896290668e68b4ff87734a83 中修复犯罪。 该修复包含在 testcafe@1.8.0 版本中。

关于node.js - Windows 上的 TestCafe 失败,并出现 spawn powershell.exe ENOENT 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59759287/

相关文章:

node.js - 我可以显示 npm 运行的扩展命令吗?

javascript - 似乎无法使用 express 在 Node.js 上启动和运行 MySQL(之前只使用过 WAMP/MAMP)

vba - VBA中的左函数

powershell - PowerShell的Restart-Service cmdlet的捕获结果

php - 有人知道 PHP 的 RSPec 之类的东西吗?

ruby-on-rails - 如何使用 rspec-rails2 测试 View 页面(分页)?

testing - Im textbox From 1 to 1000 write testcase to allow only multiple of 5 使用等效分区和边界值分析?

node.js - 输出已安装的 node.js 库的所有许可证

node.js - angular2 quick start 只显示 Loading .. 而不是 index.html 的内容

powershell - 如何使用 PowerShell 访问第三方 OLE DLL 的方法和属性?