You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
All versions of npm init hang on Node 8.1.0 #13557
To reproduce, with Node 8.1.0 and any version of npm (we've explicitly tested w/ 2, 3, 4 & 5):
$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg> --save` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
name: (x)
version: (1.2.0)
At the prompt for version Node stops accepting input and doesn't respond to ^Z or ^C. (It does respond to kill -STOP and kill -INT. Continuing the process after a STOP results in keyboard input being echoed but the process still does not run.)
@Fishrock123 Apparently, npm init (or rather the read module) creates a new readline instance per question that it asks…
@jasnell You’re right, reverting is a bit silly, this is easy to fix (in a somewhat obvious way, in hindsight): okay, no, the original patch was incorrect and should be reverted.
That definitely seems like a bug then. It really should not be emitting close at that point. Let's see if we can fix that issue quickly before reverting the other commit
Reacted by Darcy Clarke, Gibson Fahnestock, Parham Alvani, Manpreet Singh, Alexey Mikhaylov, Ben Newman, Luke Deen Taylor, Yahor Siarheyenka, Courtney Faulkner, Alan Tai and 10 more
Reacted by Steven, Daniel Shneyder, Matt Black, Bruno Devaux and Nong (Ron) Wang
@131 see #13560 (comment), it'll be fixed in the next v8.x release, scheduled for next Tuesday.
Reacted by James Cuénod, Jacob Mason, Allan Kimmer Jensen, Hendrik Belitz, Mark Apinis, Marco Scannadinari, Steven, Tad Lispy, Andrea Richiardi, Alexandru Sfirlogea and 1 more
Reacted by Bernard Mordan, Grégoire Lodi, Marcio Puga, Abhinav Gauniyal and Zhong-wei
Reacted by Maisie Bell, Marco Scannadinari, Tad Lispy, Alexandru Sfirlogea and Marcus Bergman
Activity
krokofant commentedon Jun 8, 2017
yarn behaves the same
addaleax commentedon Jun 8, 2017
This was caused by 81ddeb9, /cc @gibfahn @jasnell
@mscdex I’m removing the v8.x label because this is an issue on master as well.
Fishrock123 commentedon Jun 8, 2017
I can't seem to reproduce on
masteror8.1.0?The
WARNdoes seem to be on the wrong line though?Fishrock123 commentedon Jun 8, 2017
I'd be curious to see what e.g. the following patch prints pre/post 81ddeb9
addaleax commentedon Jun 8, 2017
@Fishrock123 I’m not sure I’m reading your output correctly – you first have to enter the package name, only after that I can’t quite anymore.
iarna commentedon Jun 8, 2017
@addaleax lol! I opened this issue and turned to @zkat and said "I bet Anna sees this and knows exactly the cause"
Fishrock123 commentedon Jun 8, 2017
Oops. 🙊
It appears a
closeis emitted after pressingenterunder normal circumstances...addaleax commentedon Jun 8, 2017
@Fishrock123 Apparently,
npm init(or rather thereadmodule) creates a new readline instance per question that it asks…@jasnell You’re right,
reverting is a bit silly, this is easy to fix (in a somewhat obvious way, in hindsight):okay, no, the original patch was incorrect and should be reverted.I’ll have a PR and tests up in a bit.
@iarna Naaaaw! 💙
Fishrock123 commentedon Jun 8, 2017
While that seems inefficient,
readlinedoes apparently emitcloseat the end of each line: https://nodejs.org/dist/latest-v8.x/docs/api/readline.html#readline_event_close(Which leads me to believe the patch above may be a bit inefficient too? We can discuss in a PR.)
addaleax commentedon Jun 8, 2017
Are you sure? I don’t really read the docs as stating that…
jasnell commentedon Jun 8, 2017
That definitely seems like a bug then. It really should not be emitting close at that point. Let's see if we can fix that issue quickly before reverting the other commit
addaleax commentedon Jun 8, 2017
It doesn’t, it’s the
readmodule that closes the readline instance explicitly after having read the answer.addaleax commentedon Jun 8, 2017
PR to fix/revert: #13560
131 commentedon Jun 10, 2017
Following sample code is broken, waiting for you @addaleax !
gibfahn commentedon Jun 10, 2017
@131 see #13560 (comment), it'll be fixed in the next v8.x release, scheduled for next Tuesday.
test: add regression test for 13557
Bamieh commentedon Jun 29, 2017
i'm still facing this issue guys
addaleax commentedon Jun 29, 2017
@Bamieh As described above, upgrade Node to the latest version and you will be fine.
Bamieh commentedon Jun 29, 2017
@addaleax true, it gets fixed when upgrading node, i only upgraded npm before and it didnt work. thanks
gezquinndesign commentedon Aug 1, 2018
This is still affecting the loopback-cli
It freezes after giving the application name...
node version - v10.7.0
npm version=6.1.0
loopback- 4.2.0
OS- windows10
anyone help please?
Thanks
test: add regression test for 13557