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

bug: postinstall fails in pnpm-monorepo #129

Closed
christiantakle opened this issue Nov 8, 2022 · 5 comments · Fixed by #130
Closed

bug: postinstall fails in pnpm-monorepo #129

christiantakle opened this issue Nov 8, 2022 · 5 comments · Fixed by #130

Comments

@christiantakle
Copy link

christiantakle commented Nov 8, 2022

The "postinstall" is specific to working on the package itself and not useful for consumers of the package.

Consider "prepare" instead? or maybe there is a better match: https://docs.npmjs.com/cli/v8/using-npm/scripts#life-cycle-scripts. You can also consider a custom bootstrap script for when you need to work on the package.

Description

postinstall fails in a pnpm monorepo

Expected outcome

That normalize-diacritics installs correctly

Actual outcome

<my-user> and <our-repo> is redacted information

...
node_modules/.pnpm/normalize-diacritics@3.0.11/node_modules/normalize-diacritics: Running postinstall script, failed in 481ms
.../node_modules/normalize-diacritics postinstall$ sh postinstall.sh
│ npm ERR! code ENOENT
│ npm ERR! syscall lstat
│ npm ERR! path /home/<my-user>/work/<our-repo>/lib
│ npm ERR! errno -2
│ npm ERR! enoent ENOENT: no such file or directory, lstat '/home/<my-user>/work/<our-repo>/lib'
│ npm ERR! enoent This is related to npm not being able to find a file.
│ npm ERR! enoent
│ npm ERR! A complete log of this run can be found in:
│ npm ERR!     /home/<my-user>/.npm/_logs/2022-11-08T09_59_58_504Z-debug-0.log
...

The line that triggers the error:
postinstall.sh

npx -y -- zx@latest ./postinstall.mjs

Steps to reproduce

We run (in our monorepo)
<repo>/package.json

    "workspace--install": "git config  url.\"ssh://git@\".insteadOf git:// && pnpm recursive install --link-workspace-packages",

Versions of affected system

  • package: normalize-diacritics@3.0.11
  • pnpm --version => 7.14.0
  • nix --version => nix (Nix) 2.11.1
  • platform: Linux <my-hostname> 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 GNU/Linux
@CanRau
Copy link

CanRau commented Nov 20, 2022

Just wanted to install the package and ran into the same issue that I can't install because of the postinstall script failing

@christiantakle
Copy link
Author

@CanRau

Temporary solutions while we wait for feedback.

@CanRau
Copy link

CanRau commented Nov 21, 2022

Thanks for the workarounds, still using yarn at the moment, maybe there would be options too but I think I have my string normalization in place already 🤓

@motss
Copy link
Owner

motss commented Nov 21, 2022

@christiantakle @CanRau Thanks for reporting this. The fix will shortly be ready.

@motss
Copy link
Owner

motss commented Nov 21, 2022

@christiantakle @CanRau Thanks for waiting for the fix. Please update to v3.0.12. 🙇

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

Successfully merging a pull request may close this issue.

3 participants