Skip to content

spawn: set encoding utf8Β #432

Open
Open
@milahu

Description

@milahu

so we get pretty error messages

add

   encoding: "utf8",

to

const defaultOptions: SpawnSafeOptions = {
logStdErrOnError: true,
throwOnError: true,
}

currently we get binary output, for example

patch-package jest-snapshot 
patch-package 6.5.0
β€’ Creating temporary folder
β€’ Installing [email protected] with yarn
warning package.json: No license field
warning No license field
error Couldn't find any versions for "jest-snapshot" that matches "26.6.2, jest-snapshot@npm:^26.6.2"

{
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer 79 61 72 6e 20 69 6e 73 74 61 6c 6c 20 76 31 2e 32 32 2e 31 39 0a 69 6e 66 6f 20 4e 6f 20 6c 6f 63 6b 66 69 6c 65 20 66 6f 75 6e 64 2e 0a 5b 31 2f 34 ... 113 more bytes>,
    <Buffer 77 61 72 6e 69 6e 67 20 70 61 63 6b 61 67 65 2e 6a 73 6f 6e 3a 20 4e 6f 20 6c 69 63 65 6e 73 65 20 66 69 65 6c 64 0a 77 61 72 6e 69 6e 67 20 4e 6f 20 ... 116 more bytes>
  ],
  pid: 2418758,
  stdout: <Buffer 79 61 72 6e 20 69 6e 73 74 61 6c 6c 20 76 31 2e 32 32 2e 31 39 0a 69 6e 66 6f 20 4e 6f 20 6c 6f 63 6b 66 69 6c 65 20 66 6f 75 6e 64 2e 0a 5b 31 2f 34 ... 113 more bytes>,
  stderr: <Buffer 77 61 72 6e 69 6e 67 20 70 61 63 6b 61 67 65 2e 6a 73 6f 6e 3a 20 4e 6f 20 6c 69 63 65 6e 73 65 20 66 69 65 6c 64 0a 77 61 72 6e 69 6e 67 20 4e 6f 20 ... 116 more bytes>,
  error: null
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions