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

compat: postinstall fails for some modules during npm install #2013

Closed
kt3k opened this issue Mar 8, 2022 · 5 comments
Closed

compat: postinstall fails for some modules during npm install #2013

kt3k opened this issue Mar 8, 2022 · 5 comments

Comments

@kt3k
Copy link
Member

kt3k commented Mar 8, 2022

When the npm module has postinstall script in package.json, then npm install with compat mode stops with errors.

Known npm modules which cause this error:

  • es5-ext
  • core-js-pure
@bartlomieju
Copy link
Member

Right... postinstall script. We need to find some sane solution for that.

@kt3k kt3k changed the title compat: postinstall handling is wrong with npm install compat: postinstall fails for some modules during npm install Mar 9, 2022
@kt3k
Copy link
Member Author

kt3k commented Mar 9, 2022

es5-ext has node -e \"try{require('./_postinstall')}catch(e){}\" in postinstall
https://github.com/medikoo/es5-ext/blob/406507807f96aa092ee252ab5fe759fc0dd4b778/package.json#L115

and that command passed to child_process.spawn.

core-js-pure also has the same postinstall script https://github.com/zloirock/core-js/blob/6eb66ebbcd9c50a8f337c87992076b51a4beecec/packages/core-js-pure/package.json#L55

@kt3k
Copy link
Member Author

kt3k commented Mar 9, 2022

dirty solution could be parsing the input at the beginning of child_process.spawn, and change the behavior if the input is node command with -e option...

@kt3k
Copy link
Member Author

kt3k commented Apr 6, 2022

These scripts seem technically irrelevant to make them working (political messages and donation requests). Maybe ignoring these postinstall scripts by hard coding would be a possible option

@kt3k
Copy link
Member Author

kt3k commented Mar 21, 2023

postinstall issue is tracked in denoland/deno#16164

@kt3k kt3k closed this as completed Mar 21, 2023
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

2 participants