我尝试在 Windows10 上运行 TestCafe 以进行评估,但按照说明安装后 https://devexpress.github.io/testcafe/documentation/using-testcafe/installing-testcafe.html#local-installation当使用使用浏览器作为选项的选项运行 testcafe 时,我总是收到以下错误,即除 testcafe -h
和 testcafe -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/