1. When executing yarn, an error is reported: Failed to apply patch for package laravel-mix. patches\Laravel-mix+6.0.43.patch could not be parsed. as shown in Figure 1
Figure 1
PS E:\wwwroot\object> yarn
yarn install v1.22.15
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ patch-package
patch-package 6.4.7
Applying patches...
concat@1.0.3 ✔
eslint-plugin-jsonc@2.3.0 ✔
**ERROR** Failed to apply patch for package laravel-mix
This happened because the patch file patches\laravel-mix+6.0.43.patch could not be parsed.
If you just upgraded patch-package, you can try running:
cd patches\laravel-mix+6.0.43.patc
patch -p1 -i h
npx patch-package laravel-mix
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.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
2. Check the git log, the previous version of patches\Laravel-mix+6.0.43.patch is: patches\laravel-mix+6.0.48.patch. as shown in Figure 2
Figure 2
3. After deleting the directory: node_modules, execute again: yarn, and still report the same error. as shown in Figure 3
Figure 3
4. Reference prompt, execute: NPX patch-package laravel-mix. as shown in Figure 4
Figure 4
PS E:\wwwroot\object> npx patch-package laravel-mix
patch-package 6.4.7
• Creating temporary folder
• Installing laravel-mix@6.0.43 with yarn
• Diffing your files with clean files
⁉️ Not creating patch file for package 'laravel-mix'
⁉️ There don't appear to be any changes.
npm notice
npm notice New minor version of npm available! 8.1.2 -> 8.12.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.12.1
npm notice Run npm install -g npm@8.12.1 to update!
npm notice
5. Execute again: yarn, still report an error. Reference: https://github.com/ds300/patch-package/issues/191 . Replace newlines from CRLF with LF. No more errors. as shown in Figure 5
Figure 5
Leave a Reply