yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.4k stars 2.72k forks source link

Postinstall script with Inquirer CLI exits with error #7983

Open bsian03 opened 4 years ago

bsian03 commented 4 years ago

Bug description

Installing a module which has a postinstall script which utilises the Inquirer module causes yarn to exit with error code 1 without allowing the user to interact with the CLI

Command

yarn install [module which contains postinstall]

What is the current behavior? Exits with code 1, giving the output as whatever the first prompt is. This does not seem to happen when running yarn run postinstall in the module directly

What is the expected behavior? Interactive CLI should run as normal - just as it does when installing with npm

Steps to Reproduce

  1. Find a module which utilises an interactive CLI in postinstall. For this example I'm using bsian03/AxonCore#dev-docs (my fork of a repository which I'm working on dynamic typings based on user input for)
  2. Install that module

Environment

bsian03 commented 4 years ago

Just a note, our CI errors with code 130 and not code 1 as I mentioned, code 1 only seems to happen upon user installation This is no longer relevant and the error code with the CI has been fixed