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.42k stars 2.72k forks source link

yarn install fails on checkpoint scripts #5453

Open ermik opened 6 years ago

ermik commented 6 years ago

Do you want to request a feature or report a bug?

It's a bug.

What is the current behavior? Attempting to install a package with an install checkpoint script (accepting terms and conditions) halts yarn install execution.

Package on npm: @squarespace/server
Succeeds with npm install: yes Tested: yes, with a single package in package.json this still fails

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior? halt install and wait for the checkpoint script to successfully execute (exit)

Please mention your node.js, yarn and operating system version. node 9.3.0 yarn 1.5.1 osx 10.13.3

rally25rs commented 6 years ago

I think npm runs the install scripts serially, and the user can interact with the script.

I don't think yarn exposes stdin to these scripts to allow them to be "interactive". I'm pretty sure we also run multiple in parallel to speed things up, so I doubt we can easily feed keyboard input to the running scripts.

@yarnpkg/core this one seems like it might be tricky. Anyone have any ideas or want to tackle this?

edit

Adding yarn output for reference.

~/Projects/yarn-test πŸ’   yarn add @squarespace/server
yarn add v1.5.1
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
[4/4] πŸ“ƒ  Building fresh packages...
[-/3] β‘€ waiting...
[-/3] ⠁ waiting...
[-/3] β’€ waiting...
[-/3] ⠈ waiting...
[-/3] β „ waiting...
[-/3] β’€ waiting...
[2/3] β’€ uws
[3/3] β’€ @squarespace/server: To read the file, press Enter. :
[-/3] β’€ waiting...

You can see the script is waiting for input from the user (and is running uws's script at the same time).

ermik commented 6 years ago

Don't know how either work, but one can assume the script execution like this would be blocking, such as while other tasks may continue in the background (resolving dependencies) β€”Β the process should reach a point where yarn will pause and wait for the blocking script to successfully exit.