【问题标题】:Yarn pnp causes drive letter mismatch on Windows with TestcafeYarn pnp 导致 Windows 上与 Testcafe 的驱动器号不匹配
【发布时间】:2022-10-06 17:20:30
【问题描述】:

Testcafe 无法使用yarn pnp 编译我的测试,通过在.yarnrc 中设置这两个属性切换到yarn pnp 后遇到以下错误:

nodeLinker: \"pnp\"
pnpMode: \"strict\"

错误信息:

code: \'E1035\'
Error: TypeScript compilation failed.
C:/testcafe/test.ts (13, 17): File name 
\'C:/testcafe/.yarn/cache/testcafe-npm-2.0.0-395078fea1-9192f88fb7.zip/node_modules/testcafe/ts-defs/index.d.ts\' 
differs from already included file name 
\'c:/testcafe/.yarn/cache/testcafe-npm-2.0.0-395078fea1-9192f88fb7.zip/node_modules/testcafe/ts-defs/index.d.ts\' only in casing.
  The file is in the program because:
    Root file specified for compilation
    Imported via \'testcafe\' from file \'C:/testcafe/test.ts\' with packageId \'testcafe/ts-defs/index.d.ts@2.0.0\'

forceConsistentCasingInFileNames: false 不能用作解决方法,因为它不是文件而是路径名

    标签: typescript testing testcafe yarnpkg-v2 yarn-v2


    【解决方案1】:

    看起来这个问题与“纱线”有关并且已经修复(参见https://github.com/yarnpkg/yarn/pull/7007)。确保您使用的是带有必要修复的yarn 版本。

    【讨论】:

    • 我正在使用最新的纱线版本,我的猜测是问题是,虽然纱线只使用小写字母,但 testcafe 可能会在编译期间使用大写驱动器号在内部导入自身
    • 从您的描述中不清楚您是如何遇到此错误的。请与我们分享重现它所需的步骤。
    猜你喜欢
    • 2021-03-27
    • 1970-01-01
    • 1970-01-01
    • 2019-04-13
    • 2021-04-18
    • 2022-01-02
    • 2010-09-06
    • 1970-01-01
    • 2021-04-12
    相关资源
    最近更新 更多