ds300 / patch-package

Fix broken node modules instantly 🏃🏽‍♀️💨
MIT License
10.36k stars 290 forks source link

Can't patch package- fails with status 1, no error #484

Open tlangston23 opened 1 year ago

tlangston23 commented 1 year ago

Hi I'm still getting the below error even though it was allegedly fixed in an earlier version:

C:\TMAX-R\trunk\lucid_client>npx patch-package @inovua/reactdatagrid-enterprise npm WARN config global --global, --local are deprecated. Use --location=global instead. patch-package 8.0.0 • Creating temporary folder • Installing @inovua/reactdatagrid-enterprise@5.9.2 with npm { status: 1, signal: null, output: [ null, null, null ], pid: 24900, stdout: null, stderr: null, error: null }

C:\TMAX-R\trunk\lucid_client\node_modules\patch-package\dist\makePatch.js:395 throw e; ^ { status: 1, signal: null, output: [ null, null, null ], pid: 24900, stdout: null, stderr: null, error: null }

quolpr commented 1 year ago

Same issue:

npx patch-package  snabbdom
patch-package 8.0.0
• Creating temporary folder
• Installing snabbdom@0.7.3 with yarn

{
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer 1b 5b 33 31 6d 1b 5b 31 6d 55 6e 6b 6e 6f 77 6e 20 53 79 6e 74 61 78 20 45 72 72 6f 72 1b 5b 32 32 6d 1b 5b 33 39 6d 3a 20 55 6e 73 75 70 70 6f 72 74 ... 142 more bytes>,
    <Buffer >
  ],
  pid: 77815,
  stdout: <Buffer 1b 5b 33 31 6d 1b 5b 31 6d 55 6e 6b 6e 6f 77 6e 20 53 79 6e 74 61 78 20 45 72 72 6f 72 1b 5b 32 32 6d 1b 5b 33 39 6d 3a 20 55 6e 73 75 70 70 6f 72 74 ... 142 more bytes>,
  stderr: <Buffer >,
  error: null
}

/Users/quolpr/.npm/_npx/1a782c0cdc01f9d4/node_modules/patch-package/dist/makePatch.js:395
        throw e;
        ^
{
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(192) [Uint8Array] [
       27,  91,  51,  49, 109,  27,  91,  49, 109,  85, 110, 107,
      110, 111, 119, 110,  32,  83, 121, 110, 116,  97, 120,  32,
       69, 114, 114, 111, 114,  27,  91,  50,  50, 109,  27,  91,
       51,  57, 109,  58,  32,  85, 110, 115, 117, 112, 112, 111,
      114, 116, 101, 100,  32, 111, 112, 116, 105, 111, 110,  32,
      110,  97, 109, 101,  32,  40,  34,  45,  45, 105, 103, 110,
      111, 114, 101,  45, 115,  99, 114, 105, 112, 116, 115,  34,
       41,  46,  10,  10,  36,  32, 121,  97, 114, 110,  32, 105,
      110, 115, 116,  97,
      ... 92 more items
    ],
    Buffer(0) [Uint8Array] []
  ],
  pid: 77815,
  stdout: Buffer(192) [Uint8Array] [
     27,  91,  51,  49, 109,  27,  91,  49, 109,  85, 110, 107,
    110, 111, 119, 110,  32,  83, 121, 110, 116,  97, 120,  32,
     69, 114, 114, 111, 114,  27,  91,  50,  50, 109,  27,  91,
     51,  57, 109,  58,  32,  85, 110, 115, 117, 112, 112, 111,
    114, 116, 101, 100,  32, 111, 112, 116, 105, 111, 110,  32,
    110,  97, 109, 101,  32,  40,  34,  45,  45, 105, 103, 110,
    111, 114, 101,  45, 115,  99, 114, 105, 112, 116, 115,  34,
     41,  46,  10,  10,  36,  32, 121,  97, 114, 110,  32, 105,
    110, 115, 116,  97,
    ... 92 more items
  ],
  stderr: Buffer(0) [Uint8Array] [],
  error: null
}
shukerullah commented 1 year ago

Same

facetious commented 1 year ago

This happened to me when the registry listed in my package-lock.json didn't match the registry in my .npmrc.

eeshankeni commented 1 year ago

This has been happening to me as well all of a sudden

Edit: Using npx patch-package instead of just patch-package fixed the issue.

hwride commented 9 months ago

I still get the problem using npx patch-package. We're using a private registry as well, so could be related.

Edit: when I added proper private registry configuration to my ~/.npmrc then the command worked. Previously I only had the configuration in the repo itself, and when patch-package installs the dependency in a temporary directory it seems it didn't pick up that up.

pep108 commented 4 months ago

I had the same problem, even when using npx patch-package. what solved it for me was to switch from node v21.6.2 to version to 17.7.2.

cdavie-artium commented 4 months ago

Neither downgrading node nor .npmrc configurations fixed this error for me.

fatinfarzanaazizan commented 4 months ago

Neither downgrading node nor .npmrc configurations fixed this error for me.

same here. i tried downgrading yarn ( from berry to yarn 1) but doesn't work either

fatinfarzanaazizan commented 4 months ago

after a few tries, what worked for me was to downgrade yarn (from berry to yarn 1) AND to downgrade node version to 17 (16 and 20 don't work for some reason). Hopefully the team can get it to work with node 20. Thanks

Rapol commented 1 month ago

I was trying to patch a private package. The npmrc with the configuration to access the private package is in the repo not in the user global ~/.npmrc. After updating the global npmrc with the same settings as the repo one, it started working.

node: v20.11.1 npm: 10.2.4 patch-package: 8.0.0