berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug?]: yarn dlx fails if using injectEnvironmentFiles in v4-rc48

Open lukeapage opened this issue 1 year ago • 5 comments

Self-service

  • [ ] I'd be willing to implement a fix

Describe the bug

running

yarn dlx -q envinfo --preset jest

gives the output:

Internal Error: ENOENT: no such file or directory, open 'C:\Users\xxx\AppData\Local\Temp\xfs-b6733aeb\dlx-14808\.env'
Error: ENOENT: no such file or directory, open 'C:\Users\xxx\AppData\Local\Temp\xfs-b6733aeb\dlx-14808\.env'

with the config

compressionLevel: mixed

enableGlobalCache: true

enableStrictSsl: false

httpTimeout: 1000000

injectEnvironmentFiles:
  - .env
  - .env.user?

nodeLinker: node-modules

I can add a ? after .env to make it optional but then all users would have to always make the env files optional for them to work with yarn dlx, so it seems like bug.

To reproduce

See above

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
  Binaries:
    Node: 18.16.1 - ~\AppData\Local\Temp\xfs-968f78b9\node.CMD
    Yarn: 4.0.0-rc.48.git.20230729.hash-8d70543 - ~\AppData\Local\Temp\xfs-968f78b9\yarn.CMD
    npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    jest: 29.4.2 => 29.4.2

Additional context

No response

lukeapage avatar Aug 23 '23 12:08 lukeapage