Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node.js simply not working, at all #364

Closed
rwxrob opened this issue Jun 9, 2014 · 14 comments
Closed

node.js simply not working, at all #364

rwxrob opened this issue Jun 9, 2014 · 14 comments

Comments

@rwxrob
Copy link

rwxrob commented Jun 9, 2014

No matter what I try, after 4 hours I can't get around this one. I've changed the paths and more.

net.js:605
throw new TypeError('invalid data');

TypeError: invalid data
at Socket.write (net.js:605:11)
at REPLServer.Interface.prompt (readline.js:176:17)
at REPLServer.displayPrompt (repl.js:397:8)
at new REPLServer (repl.js:328:8)
at Object.exports.start (repl.js:337:14)
at C:\Users\MrRob\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\config\NodeJS\repl.js:5:20
at Object. (C:\Users\MrRob\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\config\NodeJS\repl.js:38:3)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)

_Repl Closed_

@teodoran
Copy link

I had the same problem, but managed to fix it by modifying the [path to Sublime Text]/Packages/SublimeREPL/config/NodeJS/repl.js config file.

On line 5 in the file there is a repl.start() call with a config object as an argument:

var rep = repl.start({
    prompt:    null, //'> ',  
    source:    null, //process.stdin,
    eval:      null, //require('vm').runInThisContext,
    useGlobal: true, //false
    useColors: false
});

@wuub has helpfully left in some comments with other possible config values, and for some strange reason, changing the "prompt" value to '>' fixed my problem. For easy copy/pasting, this was the code that worked for me:

var rep = repl.start({
    prompt:    '> ', //null, 
    source:    null, //process.stdin,
    eval:      null, //require('vm').runInThisContext,
    useGlobal: true, //false
    useColors: false
});

@iainwatt
Copy link

worked!

@ackvf
Copy link

ackvf commented Aug 21, 2015

Changing to empty string '' worked as well

var rep = repl.start({
    prompt:    '',   //null, 
    source:    null, //process.stdin,
    eval:      null, //require('vm').runInThisContext,
    useGlobal: true, //false
    useColors: false
});

you can also input some fancy texts like "\n> " or "NEW COMMAND\n---->"

@TimHeckel
Copy link

worked! thanks a bunch.

@butgit
Copy link

butgit commented Nov 2, 2015

IT works like magic. Thanks.

@OliverJAsh
Copy link

This is still an issue, will it get fixed in master?

@PetrochukM
Copy link

Hey! It can be a little hard to find on the windows. Here is the path I found the config files @ C:\Users\micha\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\config\NodeJS

@goldnetonline
Copy link

A bottle of soda @teodoran, so saved my day.

@Demetrio92
Copy link

why on earth isn't this still a default setup? 2 years later the same error which is fixable by modifying a config file...

@ptolideh
Copy link

Wow...Super easy fix! thanks Rob

@kirin-yuen
Copy link

@teodoran it works, but how do you find this way to fix it? Modify the repl.start option one by one?

@liyachun01
Copy link

Thanks!

ryanpcmcquen pushed a commit to ryanpcmcquen/SublimeREPL that referenced this issue Jun 12, 2019
@ErAz7
Copy link

ErAz7 commented Jul 28, 2019

I had the same problem, but managed to fix it by modifying the [path to Sublime Text]/Packages/SublimeREPL/config/NodeJS/repl.js config file.

On line 5 in the file there is a repl.start() call with a config object as an argument:

var rep = repl.start({
    prompt:    null, //'> ',  
    source:    null, //process.stdin,
    eval:      null, //require('vm').runInThisContext,
    useGlobal: true, //false
    useColors: false
});

@wuub has helpfully left in some comments with other possible config values, and for some strange reason, changing the "prompt" value to '>' fixed my problem. For easy copy/pasting, this was the code that worked for me:

var rep = repl.start({
    prompt:    '> ', //null, 
    source:    null, //process.stdin,
    eval:      null, //require('vm').runInThisContext,
    useGlobal: true, //false
    useColors: false
});

The reason might be the '>' character appears in stdout when you enter "node" in cmd, so when it is set to null, it won't be detected but when you change it to '>', it simply detects that process is waiting for input
This was the approach I used in nodeJS child processes to detect if child process is waiting for interaction from node process and perhaps is the case here

@mayank-imeleo
Copy link

I had the same problem, but managed to fix it by modifying the [path to Sublime Text]/Packages/SublimeREPL/config/NodeJS/repl.js config file.

On line 5 in the file there is a repl.start() call with a config object as an argument:

var rep = repl.start({
    prompt:    null, //'> ',  
    source:    null, //process.stdin,
    eval:      null, //require('vm').runInThisContext,
    useGlobal: true, //false
    useColors: false
});

@wuub has helpfully left in some comments with other possible config values, and for some strange reason, changing the "prompt" value to '>' fixed my problem. For easy copy/pasting, this was the code that worked for me:

var rep = repl.start({
    prompt:    '> ', //null, 
    source:    null, //process.stdin,
    eval:      null, //require('vm').runInThisContext,
    useGlobal: true, //false
    useColors: false
});

Thanks...this worked for me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests