nodejs vs node on ubuntu 12.04

前端 未结 20 2140
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:15

    Apparently the solution differs between Ubuntu versions. Following worked for me on Ubuntu 13.10:

    sudo apt-get install nodejs-legacy
    

    HTH

    Edit: Rule of thumb:

    If you have installed nodejs but are missing the /usr/bin/node binary, then also install nodejs-legacy. This just creates the missing softlink.

    According to my tests, Ubuntu 17.10 and above already have the compatibility-softlink /usr/bin/node in place after nodejs is installed, so nodejs-legacy is missing from these releases as it is no more needed.

提交回复
热议问题