-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
All versions of npm init
hang on Node 8.1.0
#13557
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
yarn behaves the same |
I can't seem to reproduce on The
|
I'd be curious to see what e.g. the following patch prints pre/post 81ddeb9 diff --git a/lib/readline.js b/lib/readline.js
index 6a1ed150d7..6113846c91 100644
--- a/lib/readline.js
+++ b/lib/readline.js
@@ -1039,6 +1039,8 @@ function emitKeypressEvents(stream, iface) {
} else {
stream.on('newListener', onNewListener);
}
+ iface.on('close', () => process._rawDebug('## CLOSE'))
+ stream.on('data', () => process._rawDebug('## DATA'))
if (iface) {
iface.once('close', () => { stream.removeListener('data', onData); });
} |
@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. |
Oops. 🙊 It appears a
|
@Fishrock123 Apparently, @jasnell You’re right, --- a/lib/readline.js
+++ b/lib/readline.js
@@ -1040,7 +1040,11 @@ function emitKeypressEvents(stream, iface) {
stream.on('newListener', onNewListener);
}
if (iface) {
- iface.once('close', () => { stream.removeListener('data', onData); });
+ iface.once('close', () => {
+ stream[KEYPRESS_DECODER] = null;
+ stream[ESCAPE_DECODER] = null;
+ stream.removeListener('data', onData);
+ });
}
} I’ll have a PR and tests up in a bit. @iarna Naaaaw! 💙 |
While that seems inefficient, (Which leads me to believe the patch above may be a bit inefficient too? We can discuss in a PR.) |
Are you sure? I don’t really read the docs as stating that… |
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 |
It doesn’t, it’s the |
PR to fix/revert: #13560 |
Following sample code is broken, waiting for you @addaleax ! const readline = require('readline')
function prompt(opts, cb) {
var input = process.stdin
var output = process.stdout
var terminal = !!(output.isTTY)
var rlOpts = { input, output, terminal }
var rl = readline.createInterface(rlOpts)
rl.setPrompt(opts.prompt)
rl.prompt()
rl.on('line', function(line){
rl.close()
cb(null, line);
})
}
const foo = function() {
prompt( {prompt : "#>" }, function(err, line ){
console.log("Got", err, line);
foo();
})
}
foo(); |
@131 see #13560 (comment), it'll be fixed in the next v8.x release, scheduled for next Tuesday. |
i'm still facing this issue guys |
@Bamieh As described above, upgrade Node to the latest version and you will be fine. |
@addaleax true, it gets fixed when upgrading node, i only upgraded npm before and it didnt work. thanks |
This is still affecting the loopback-cli It freezes after giving the application name... node version - v10.7.0 anyone help please? Thanks |
To reproduce, with Node 8.1.0 and any version of npm (we've explicitly tested w/ 2, 3, 4 & 5):
At the prompt for version Node stops accepting input and doesn't respond to ^Z or ^C. (It does respond to
kill -STOP
andkill -INT
. Continuing the process after a STOP results in keyboard input being echoed but the process still does not run.)The text was updated successfully, but these errors were encountered: