Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing at patch-package when using pnpm #33

Open
aaweb opened this issue Apr 6, 2023 · 3 comments
Open

Failing at patch-package when using pnpm #33

aaweb opened this issue Apr 6, 2023 · 3 comments

Comments

@aaweb
Copy link

aaweb commented Apr 6, 2023

Hey there

Great project! I'm trying to get the latest version running on our project building on GitHub Actions CI which uses pnpm.

{
"time":1680695309474,
"hostname":"fv-az357-761",
"pid":1765,
"level":"error",
"name":"pnpm",
"code":"ELIFECYCLE",
"errno":1,
"pkgid":"@c-frame/[email protected]",
"stage":"postinstall",
"script":"patch-package",
"pkgname":"@c-frame/aframe-physics-system",
"name":"pnpm",
"err":{
  "name":"pnpm",
  "message":"@c-frame/[email protected] postinstall: `patch-package`\n
      Exit status 1",
   "code":"ELIFECYCLE",
   "stack":"pnpm: @c-frame/[email protected] postinstall: `patch-package`\n
     Exit status 1\n
    at EventEmitter.<anonymous> (/home/runner/setup-pnpm/node_modules/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:99647:17)\n
     at EventEmitter.emit (node:events:513:28)\n
     at ChildProcess.<anonymous> (/home/runner/setup-pnpm/node_modules/.pnpm/[email protected]/node_modules/pnpm/dist/pnpm.cjs:83505:18)\n    
     at ChildProcess.emit (node:events:513:28)\n    
     at maybeClose (node:internal/child_process:1091:16)\n    
     at Socket.<anonymous> (node:internal/child_process:449:11)\n    
     at Socket.emit (node:events:513:28)\n    
     at Pipe.<anonymous> (node:net:322:12)"
     }}

Reading the docs at https://www.npmjs.com/package/patch-package it seems like the patch-package would not be needed if using pnpm. Is this something this package can support or do you have any advice on how to best get it running?

Thank you very much.

@vincentfretin
Copy link
Member

Hi, I'm not familiar with pnpm.
You can try to fork the package and remove

"postinstall": "patch-package"

you can also remove the dependency
"patch-package": "^6.5.0",

but not mandatory.

Then apply the two patches from
https://github.com/c-frame/aframe-physics-system/tree/master/patches
From https://pnpm.io/cli/patch it seems you can the patchedDependencies field.

Then use your fork in your package.json with

"@c-frame/aframe-physics-system": "username/aframe-physics-system#commithash"

Let us know what work.

@uvesten
Copy link

uvesten commented May 2, 2023

Hi, it was actually easier than this for us. Since we don't use the ammo package, we simply used pnpm patch to patch out the patch-package dependency and postinstall step from your package, and that seems to work fine!

@diarmidmackenzie
Copy link
Member

Now we are at three-to-ammo 1.0.1, I believe we can move to ammo-debug-drawer 1.0.1 as well, and we won't need any patches any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants