ds300 / ds300/patch-package

Patch file parse error on Windows

Open
#312 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.2k
Forks
325
PR merge metrics
No merged PRs in 30d

Description

A colleague ran into this error on Windows while applying a patch I created on macOS:

Log

```
Command: node ./run.js
Arguments:
Directory: C:\dev\xxx-app\mobile-app\node_modules\postinstall-postinstall
Output:
**ERROR** Failed to apply patch for package @react-native-community/cli-platform-android

This happened because the patch file patches\@react-native-community+cli-platform-android+5.0.1-alpha.1.patch could not be parsed.

If you just upgraded patch-package, you can try running:

cd patches\@react-native-community+cli-platform-android+5.0.1-alpha.1.patc
patch -p1 -i h
npx patch-package @react-native-community/cli-platform-android
cd ../..

Otherwise, try manually creating the patch file again.

If the problem persists, please submit a bug report:

https://github.com/ds300/patch-package/issues/new?title=Patch+file+parse+error&body=%3CPlease+attach+the+patch+file+in+question%3E


error Command failed with exit code 1.
child_process.js:650
throw err;
^

Error: Command failed: yarn run postinstall

**ERROR** Failed to apply patch for package @react-native-community/cli-platform-android

This happened because the patch file patches\@react-native-community+cli-platform-android+5.0.1-alpha.1.patch could not be parsed.

If you just upgraded patch-package, you can try running:

cd patches\@react-native-community+cli-platform-android+5.0.1-alpha.1.patc
patch -p1 -i h
npx patch-package @react-native-community/cli-platform-android
cd ../..

Otherwise, try manually creating the patch file again.

If the problem persists, please submit a bug report:

https://github.com/ds300/patch-package/issues/new?title=Patch+file+parse+error&body=%3CPlease+attach+the+patch+file+in+question%3E


error Command failed with exit code 1.

at checkExecSyncError (child_process.js:611:11)
at execSync (child_process.js:647:15)
at Object. (C:\dev\xxx-app\mobile-app\node_modules\postinstall-postinstall\run.js:15:5)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
status: 1,
signal: null,
output: [
null,
,

],
pid: 3524,
stdout: ,



Command '['node.exe', 'C:\\dev\\xxx-app/scripts/yarn-1.13.0.js', 'install', '--frozen-lockfile']' returned non-zero exit status 1.
```

I put up the patch file as a Gist, so you don't have to unzip random files from the web :D

https://gist.github.com/stigi/19427e116e049e5043854a3db33db483

Opening this issue as another example that hopefully can get resolved by #301. I hope it helps confirming the issue and the fix. 🤞

Thanks for all the work ❤️

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.