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

前端 未结 3 489
终归单人心
终归单人心 2020-12-09 14:52

I have untarred node.js from the tar file given on nodejs.org, but when i try executing my js program through node command nothing happens, but on the other hand nodejs comm

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-09 15:38

    Some of these answers were difficult to understand for me, so I'm going to write the answer that would've helped me.

    node is something like a radio telemetry solving program, they just happened to snag the name node first. nodejs is what you're after. So make sure you:

    apt-get install nodejs
    

    then, to fix the lame naming issue, create a symlink. A symbolic link between node and nodejs.

    sudo ln -s /usr/bin/nodejs /usr/bin/node
    

    The first part is the original file placement, and then where it should link to. You could also create an alias in your bash profile, which is also pretty easy.

提交回复
热议问题