nodejs vs node on ubuntu 12.04

前端 未结 20 2179
Happy的楠姐
Happy的楠姐 2020-11-22 12:29

I installed nodejs on ubuntu from instructions given here

When I write node --version in the terminal I see this :
-bash: /usr/sbin/node: No

20条回答
  •  一向
    一向 (楼主)
    2020-11-22 13:17

    Adding to @randunel's correct answer (can't yet comment on SO):

    I also had to symlink /usr/local/bin/node to /usr/bin/nodejs as well.

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

    Apparently, this was overriding the /usr/bin/ node command.

    No idea how that got set, but hope it helps someone else as it was a pain to figure out why the above wasn't working for me.

提交回复
热议问题