ds300 / patch-package

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

Incompatability with pnpm when generating a diff? #265

Open Aghassi opened 4 years ago

Aghassi commented 4 years ago

I tried using this with pnpm https://pnpm.js.org/en/ and it worked only on the first try for pnpx patch-package lottie-react-web. Afterward all I got was

$ /Users/david.aghassi/web/node_modules/.bin/patch-package lottie-react-web
patch-package 6.2.2
• Creating temporary folder
• Installing lottie-react-web@2.2.2 with yarn
• Diffing your files with clean files
{ Error: ENOENT: no such file or directory, scandir '/var/folders/mj/p6yszgl92kb4q4_0hx90nqw40000gn/T/tmp-57791662T5RZumCYT/node_modules/lottie-react-web'
    at Object.readdirSync (fs.js:790:3)
    at Object.klawSync [as default] (/Users/david.aghassi/web/node_modules/.pnpm/klaw-sync@6.0.0/node_modules/klaw-sync/klaw-sync.js:13:25)
    at Object.removeIgnoredFiles (/Users/david.aghassi/web/node_modules/.pnpm/patch-package@6.2.2/node_modules/patch-package/dist/filterFiles.js:10:24)
    at Object.makePatch (/Users/david.aghassi/web/node_modules/.pnpm/patch-package@6.2.2/node_modules/patch-package/dist/makePatch.js:133:23)
    at /Users/david.aghassi/web/node_modules/.pnpm/patch-package@6.2.2/node_modules/patch-package/dist/index.js:48:25
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/david.aghassi/web/node_modules/.pnpm/patch-package@6.2.2/node_modules/patch-package/dist/index.js:47:22)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path:
   '/var/folders/mj/p6yszgl92kb4q4_0hx90nqw40000gn/T/tmp-57791662T5RZumCYT/node_modules/lottie-react-web' }
/Users/david.aghassi//web/node_modules/.pnpm/patch-package@6.2.2/node_modules/patch-package/dist/makePatch.js:183
        throw e;
        ^
Error: ENOENT: no such file or directory, scandir '/var/folders/mj/p6yszgl92kb4q4_0hx90nqw40000gn/T/tmp-57791662T5RZumCYT/node_modules/lottie-react-web'
    at Object.readdirSync (fs.js:790:3)
    at Object.klawSync [as default] (/Users/david.aghassi/web/node_modules/.pnpm/klaw-sync@6.0.0/node_modules/klaw-sync/klaw-sync.js:13:25)
    at Object.removeIgnoredFiles (/Users/david.aghassi/web/node_modules/.pnpm/patch-package@6.2.2/node_modules/patch-package/dist/filterFiles.js:10:24)
    at Object.makePatch (/Users/david.aghassi//web/node_modules/.pnpm/patch-package@6.2.2/node_modules/patch-package/dist/makePatch.js:133:23)
    at /Users/david.aghassi/web/node_modules/.pnpm/patch-package@6.2.2/node_modules/patch-package/dist/index.js:48:25
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/david.aghassi/web/node_modules/.pnpm/patch-package@6.2.2/node_modules/patch-package/dist/index.js:47:22)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Is this a known issue? If not, I can try and make a repro repo if necessary

Jolg42 commented 2 years ago

Note: pnpm added a patch command 2 days ago 🎁

See https://pnpm.io/cli/patch https://github.com/pnpm/pnpm/releases/tag/v7.4.0

robertherber commented 1 year ago

The patch experience in pnpm is currently a pain. I would love to be able to use patch-package together with pnpm, but noticed it's not currently supported. I really hope this can be considered moving forward - since the patch-package experience is so much better 👍