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
pnpm install recursive fails with bin
in sub package that must be compiled first
#1801
Comments
Any progress on this one? Or is there a workaround? |
No, this is not an easy to fix issue. A workaround would be to create a bin file that just requires the compiled bin file. That's how it is done in pnpm repo as well: https://github.com/pnpm/pnpm/blob/main/packages/pnpm/bin/pnpm.cjs |
Okay, that’s not possible in my case. I did work around it by |
So, any project that uses Typescript and monorepo is not able to use PNPM without some kind of workaround. Hmm....
|
And no way to ask to not create bin links... #459 |
not any project. This is not such a frequent scenario. It only fails if a workspace project with a compiled bin file is used in a postinstall script of another workspace project. |
No, in my case no
As workaround, I added plain JS files. |
oh, right. You are correct. If it is not used in a postinstall, there is a workaround to put regular js file wrappers. We do that in the pnpm monorepo as well: https://github.com/pnpm/pnpm/tree/main/packages/pnpm/bin Maybe as a fast workaround, we could make pnpm create the command shims even if the target does not exist yet. |
Correction — looks like indeed "not any project." In my project there is a dependency on |
This was a problem in our project monorepo. As a workaround, I started committing built js file |
In case it's helpful, I did similar in my Github workflows. - name: pnpm - output bin stubs
run: echo "#! /usr/bin/env node" > ./packages/presta/cli.js
- name: pnpm - install
run: pnpm install |
Still having this issue if a workspace in my monorepo has a Using PNPM 6.23.1 Also reproduced when cloning the repo and executing |
Ugly workaround in the meantime:
|
also still present in |
Could the "bin linking" step be re-tried for the failed links after the last install hook finished? (If a postinstall script happened to build it, it would be there) Or to expose it as cli, so we could plug it in ourselves as a postbuild step too. |
I just ran into this issue and submitted a PR for the underlying library (see above) which would fix it 🤞🏻 |
Having this issue on pnpm 8.6.2 and it prevents me from using pnpm on any NextJS 13 project. |
Me:
FWIW: My bin-producing pkg is written in typescript and my workaround before adding a prepare, was to point the <pkgJson>#bin: at index.ts, and add |
I jotted down a scrap about this: https://www.webpro.nl/scraps/compiled-bin-in-typescript-monorepo. Maybe it's helpful, please let me know it contains errors (it worked for me). |
pnpm version:
v3.2.0
Code to reproduce the issue:
See https://github.com/hgossler/pnpm-issue-1801 and follow the steps in the readme. This fails because pnpm attempts to
chmod
the bin insub-package1
before theprepare
script is run.Expected behavior:
pnpm i -r
should work.Actual behavior:
It works if you run
first.
Additional information:
node -v
prints:v11.10.1
The text was updated successfully, but these errors were encountered: