Skip to content

[Bug?]: yarn pack does not create sub-directories when using --out #6706

@GauBen

Description

@GauBen

Self-service

  • I'd be willing to implement a fix

Describe the bug

Run yarn pack --out sub/dir/package.tgz

If sub/dir does not exist, the command crashes with the following message

Error: ENOENT: no such file or directory, open '/home/project/sub/dir/package.tgz'
Emitted 'error' event on WriteStream instance at:
    at WriteStream.onerror (node:internal/streams/readable:1028:14)
    at WriteStream.emit (node:events:524:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open'
}

To reproduce

See above

Environment

yarn 4.6.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions