If you are inside the node prompt on your Mac Terminal and want to exit it, you can simply press Control + C or Control + D to exit and return to the shell prompt.
Note: Exit and Quite commands do not work with node and you will get an Uncaught ReferenceError error.
Macbook % node
Welcome to Node.js v20.6.1.
Type ".help" for more information.
> exit
Uncaught ReferenceError: exit is not defined
> quit
Uncaught ReferenceError: quit is not defined
>
Example to Quit Node on Mac Terminal
% node
Welcome to Node.js v20.6.1.
Type ".help" for more information.
>
zsh: suspended node
Macbook % node
Welcome to Node.js v20.6.1.
Type ".help" for more information.
>
(To exit, press Ctrl+C again or Ctrl+D or type .exit)
>

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!