react-slingshot icon indicating copy to clipboard operation
react-slingshot copied to clipboard

Setup script fails to complete on windows

Open jshnaidman opened this issue 7 years ago • 5 comments

Describe the bug When I run npm run setup, it completes the script but hangs after printing 'Setup Complete! Cleaning up...'

To Reproduce

npm install npm run setup

Expected behavior The setup script to complete

Desktop (please complete the following information):

  • OS: Windows 10
  • NPM version: 5.6.0
  • Nodejs version: v8.11.3

jshnaidman avatar Jun 17 '18 19:06 jshnaidman

What command line are you using?

On Sun, Jun 17, 2018 at 2:00 PM jshnaidman [email protected] wrote:

Describe the bug When I run npm run setup, it completes the script but hangs after printing 'Setup Complete! Cleaning up...'

To Reproduce

npm install npm run setup

Expected behavior The setup script to complete

Desktop (please complete the following information):

  • OS: Windows 10
  • NPM version: 5.6.0
  • Nodejs version: v8.11.3

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coryhouse/react-slingshot/issues/577, or mute the thread https://github.com/notifications/unsubscribe-auth/ABnFpe68Cnx9vc0db-l3PwCBYmh8q8-Rks5t9qdhgaJpZM4Uq77y .

-- Cory House Principal: reactjsconsulting.com http://www.reactjsconsulting.com Author: Pluralsight Courses http://www.pluralsight.com/author/cory-house

coryhouse avatar Jun 20 '18 11:06 coryhouse

I am getting the same issue, mentioned above using windows 10, command line: Git Bash

sclie001 avatar Jul 10 '18 16:07 sclie001

it seem the underlying issue lays in the prompt package as described here: https://github.com/flatiron/prompt/issues/112 Nodejs won't exit a process if there are undestroyed handles. Adding process.exit(0); in the rimraf callback for removing the tools/setup folder seems to workaround this issue.

I used the packge https://github.com/mafintosh/why-is-node-running which gives the following active handles:

# TTYWRAP
C:\xampp\htdocs\react-boilerpalte\node_modules\prompt\lib\prompt.js:76 - stdin   = options.stdin  || process.stdin;
C:\xampp\htdocs\react-boilerpalte\tools\setup\setup.js:16

m10 avatar Oct 16 '18 15:10 m10

it may be worth it to check alternatives since the prompt package seems not to be well mantained (last npm release 3 years ago, last commit 1 year ago). https://github.com/flatiron/prompt/issues/183

An alternative could be https://github.com/terkelg/prompts

m10 avatar Oct 16 '18 15:10 m10

Great point @m10 - I'm currently buried, but I'd welcome a PR to switch to prompts if you're willing.

coryhouse avatar Oct 16 '18 16:10 coryhouse