Testcafe 1.10 似乎不能通过 Yarn 2 运行,而它只是手动运行全局安装的。我得到这个输出:
ERROR Error: testcafe-legacy-api tried to access read-file-relative, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: read-file-relative (via "read-file-relative")
Required by: testcafe-legacy-api@npm:4.0.0 (via /data/Fichiers/Code/testcafe/.yarn/cache/testcafe-legacy-api-npm-4.0.0-ff97b69c8c-e4a891ec41.zip/node_modules/testcafe-legacy-api/lib/)
我可以看到它read-file-relative
被列为 的依赖项testcafe
,但不是testcafe-legacy-api
(https://yarnpkg.com/package/testcafe,https://yarnpkg.com/package/testcafe-legacy-api )的依赖项,它本身就是的依赖关系testcafe
。