nodejs vs node on ubuntu 12.04

前端 未结 20 2147
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:26

    How about using the official instructions from the nodejs site:

    For v7:

    curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
    sudo apt-get install -y nodejs
    

    For v6:

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs
    

    For v4:

    curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
    sudo apt-get install -y nodejs
    

    I've tested these from Windows bash (via subsystem for Linux - 14.04) and raspbian (ARM Debian based). Running sudo apt-get install -y nodejs without first running the setup script will result in you getting node 0.10.

    If you are planning on installing native npm modules requiring build, also run:

    sudo apt install -y build-essential
    

    Note: this is the recommended path for any Debian based distro across all architectures.

提交回复
热议问题