nodejs vs node on ubuntu 12.04

前端 未结 20 2150
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:22

    If you are on an AWS EC2 instance running an Ubuntu instance (tested on Ubuntu 16.x), then these steps might work for you:

        sudo apt-get update
        sudo apt-get --purge remove node -y
        sudo apt-get --purge remove nodejs -y
        sudo apt-get --purge remove legacy-node -y
        sudo rm  /usr/bin/node
        curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
        sudo apt-get install nodejs -y
        node -v
    

    If all is correct the last command shall have an output like : v6.x.x

    If not then run the following:

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

    Hopefully this will help. It helped me magically (hehe).

提交回复
热议问题