Ask coding questions

← Back to all posts
How do I get node into the console?
h
Crispyyy (1)

Heya, on some of my repl's node is in my console where I can do "node ." and such. But some of them I can't use node in the console. It just returns:
"ReferenceError: node is not defined
at REPL1:1:1
at Script.runInContext (vm.js:130:18)
at REPLServer.defaultEval (repl.js:444:29)
at bound (domain.js:427:14)
at REPLServer.runBound as eval
at REPLServer.onLine (repl.js:777:10)
at REPLServer.emit (events.js:314:20)
at REPLServer.EventEmitter.emit (domain.js:483:12)
at REPLServer.Interface._onLine (readline.js:329:10)"

Comments
hotnewtop
Crispyyy (1)

Found fix:
Just make your .replit file is 100% correct and up to date.

Coder100 (18874)

No, the console is not bash!
It is a node repl forever!
Not even ctrl+c can exit it!

This applies only for the nodejs language,
Another example is the python language, which has the same behavior.

But as soon as you make a .replit file, this behavior is removed.

R2D2VaderBeef (8)

Try using node in the shell maybe.

Crispyyy (1)

@R2D2VaderBeef Yeah node works in the shell. However, I need it in the console as well lol

R2D2VaderBeef (8)

@Crispyyy Yeah I'm not really sure what the Console works on, so I can't help with that. Sorry!