What is the difference between node vs nodejs command in terminal?

This is highly dependent on many factors. Mainly, it depends on what node and nodejs in your shell actually are. You can check this using type node / type nodejs and/or which node / which nodejs (or perhaps whereis). This also depends on the OS and the shell.

My guess is that which -a node will yield /usr/sbin/node which is not the nodejs executable and thus why it does not execute your node code. On my system, it is:

/usr/bin/node -> /etc/alternatives/node -> /usr/bin/nodejs

i.e. node is just a symbolic link to nodejs, which is the executable.

You can also create this alias yourself so that it overrides whatever node is for you.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)