【问题标题】:Playwright giving "npm ERR! could not determine executable to run" failure剧作家给出“npm ERR!无法确定要运行的可执行文件”失败
【发布时间】:2023-01-25 03:21:32
【问题描述】:

刚开始玩 Playwright。安装并决定运行它附带的测试。无法弄清楚为什么会失败。

$ npx playright tests                                                                                                                                            
[11:09:04]
npm ERR! could not determine executable to run
FAIL

我仔细检查了是否安装了 Typescript

$ tsc -v   
Version 4.7.4

和名字

$ npm -v                                                                                                                                                   
8.1.0

我在这个网站上查找了解决方案,它提到删除 .git/hooks 文件——我没有那个。

package.json 很简单:

{
  "name": "project01",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {},
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@playwright/test": "^1.25.2"
  }
}

我到底错过了什么?做了很多谷歌搜索,但仍然卡住了。 任何帮助,将不胜感激。

【问题讨论】:

    标签: npm playwright npx


    【解决方案1】:

    根据我的经验,npx 命令未被识别为可执行命令。 我尝试更改为 npm playwright install 并且成功了。 enter image description here

    【讨论】:

      【解决方案2】:

      所以,我不确定发生了什么,但是当我尝试一个新项目并遵循相同的步骤时,一切正常。

      我想要点是,如果发生这种情况,请尝试重新安装¯_(ツ)_/¯

      【讨论】:

        猜你喜欢
        • 2021-10-21
        • 1970-01-01
        • 2022-07-12
        • 1970-01-01
        • 2021-08-15
        • 2016-05-04
        • 1970-01-01
        • 1970-01-01
        • 2011-06-21
        相关资源
        最近更新 更多