安装节点。树莓派2。

时间:2022-09-21 01:11:23

I have installed Raspbian on my Raspberry Pi 2 and now I am trying to install node.js on it, however I am hitting an issue.

我已经在树莓派2上安装了树莓派,现在我正在尝试安装node。不过,我想说的是一个问题。

I followed the instructions and typed these commands into the terminal

我按照指示把这些命令输入终端

wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb

But when I check the version of node using

但是当我检查节点的版本时

node -v

I get this error:

我得到这个错误:

node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /lib/arm-linus-gnueabihf/libc.so.6: version `GLIBC_2.16' not found (required by node)

I am quite new to using raspberry pi, so any help to fix this issue would be great!

我对使用覆盆子派很陌生,所以任何帮助解决这个问题都是很好的!

6 个解决方案

#1


42  

Just putting the response from @Prashant Pathak above here:

在这里输入来自@Prashant Pathak的回复:

  1. Download latest nodejs build for Raspberry Pi:

    下载最新的nodejs构建树莓派:

    wget https://nodejs.org/download/release/v0.10.0/node-v0.10.0-linux-arm-pi.tar.gz

    wget https://nodejs.org/download/release/v0.10.0/node-v0.10.0-linux-arm-pi.tar.gz

  2. Unpack files in local directory:

    在本地目录下解压文件:

    cd /usr/local

    cd /usr/local

    sudo tar xzvf ~/node-v0.10.0-linux-arm-pi.tar.gz --strip=1

    sudo焦油xzvf ~ / node-v0.10.0-linux-arm-pi.tar。广州——带= 1

That's it. You can confirm it's there by checking the node version with:

就是这样。你可以通过以下节点版本来确认它的存在:

node -v 

and:

和:

npm -v

The actual url to get the files for node will change as the version changes, you can always see the list of files available for download here: http://nodejs.org/download/

获取节点文件的实际url将随着版本的更改而更改,您总是可以在这里看到可下载的文件列表:http://nodejs.org/download/

All these instructions came from: http://www.robert-drummond.com/2015/01/08/server-side-javascript-on-a-raspberry-pi-how-to-install-node-js-2/

所有这些指令都来自:http://www.robert-drummond.com/2015/01/08/server-side-javascript-on- raspberrypi -how- install-node-js-2/

#2


8  

Alternatively you can upgrade your GCC to V4.8 for this package to work!

或者,您也可以将GCC升级到V4.8,以使这个包生效!

Option 1 (the better option):

sudo apt-get update
sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50

Options 2: Upgrade to Debian Jessie

Replace all instances of "wheezy" in /etc/apt/sources.list

替换/etc/apt/sources.list中的所有“wheezy”实例

sudo apt-get update
sudo apt-get dist-upgrade

After this you download the Node.js using command line as follows:

然后下载节点。js使用命令行如下:

wget http://node-arm.herokuapp.com/node_latest_armhf.deb

Next step is to install the Node.js:

下一步是安装Node.js:

sudo dpkg -i node_latest_armhf.deb

Finally, you can verify the installation:

最后,您可以验证安装:

node -v

These instructions are mentioned on http://node-arm.herokuapp.com/

这些说明是在http://nodearm.herokuapp.com/上提到的。

#3


6  

That runs for me: http://blog.wia.io/installing-node-js-v4-0-0-on-a-raspberry-pi/

这对我来说是一个问题:http://blog.wia.io/installationnodejs-v4-00-0:)

Raspberry Pi Model A, B, B+ and Compute Module

覆盆子Pi模型A, B, B+和计算模块

wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv6l.tar.gz
tar -xvf node-v4.0.0-linux-armv6l.tar.gz
cd node-v4.0.0-linux-armv6l

Raspberry Pi 2 Model B

树莓派2型B型

wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv7l.tar.gz
tar -xvf node-v4.0.0-linux-armv7l.tar.gz
cd node-v4.0.0-linux-armv7l
sudo cp -R * /usr/local/

#4


1  

use nodejs instead of node

使用nodejs代替节点

sudo apt-get update && sudo apt-get install nodejs

sudo apt-get update & sudo apt-get install nodejs

for npm

对于npm

sudo apt-get install npm

sudo apt-get安装npm

#5


0  

The Latest Node is released for the below platforms, which helped for my old R-PI which is of model name : ARMv6-compatible processor rev 7 (v6l)

最新的节点发布在下面的平台上,这对我以前的R-PI有所帮助,它的型号是:armv6兼容的处理器rev7 (v6l)

https://nodejs.org/download/release/v4.1.0/

https://nodejs.org/download/release/v4.1.0/

node-v4.1.0-linux-arm64.tar.gz 17-Sep-2015 04:24 10886090

node-v4.1.0-linux-arm64.tar。广州17 - 9 - 2015 04:24 10886090

node-v4.1.0-linux-arm64.tar.xz 17-Sep-2015 04:24 7100824

node-v4.1.0-linux-arm64.tar。xz 17 - 9 - 2015 04:24 7100824

node-v4.1.0-linux-armv6l.tar.gz 17-Sep-2015 17:37 10763504

node-v4.1.0-linux-armv6l.tar。广州17 - 9 - 2015 17:37 10763504

node-v4.1.0-linux-armv6l.tar.xz 18-Sep-2015 00:15 7005048

node-v4.1.0-linux-armv6l.tar。今日xz 18 - 2015年9月——7005048

node-v4.1.0-linux-armv7.tar.gz 17-Sep-2015 05:17 10773951

node-v4.1.0-linux-armv7.tar。广州17 - 9 - 2015 05:17 10773951

node-v4.1.0-linux-armv7.tar.xz 17-Sep-2015 05:18 7004760

node-v4.1.0-linux-armv7.tar。xz 17 - 9 - 2015 05:18 7004760

node-v4.1.0-linux-armv7l.tar.gz 18-Sep-2015 12:58 10773951

node-v4.1.0-linux-armv7l.tar。广州18 - 9月- 2015年12:58 10773951

#6


-1  

You can try the following command: wget node-arm.herokuapp.com/node_archive_armhf.deb

您可以尝试以下命令:wget node-arm.herokuapp.com/node_archive_armhf.deb

then sudo dpkg -i node_archive_armhf.deb

然后sudo dpkg -i node_archive_armhf.deb

node -v should work now!

节点-v现在应该可以工作了!

#1


42  

Just putting the response from @Prashant Pathak above here:

在这里输入来自@Prashant Pathak的回复:

  1. Download latest nodejs build for Raspberry Pi:

    下载最新的nodejs构建树莓派:

    wget https://nodejs.org/download/release/v0.10.0/node-v0.10.0-linux-arm-pi.tar.gz

    wget https://nodejs.org/download/release/v0.10.0/node-v0.10.0-linux-arm-pi.tar.gz

  2. Unpack files in local directory:

    在本地目录下解压文件:

    cd /usr/local

    cd /usr/local

    sudo tar xzvf ~/node-v0.10.0-linux-arm-pi.tar.gz --strip=1

    sudo焦油xzvf ~ / node-v0.10.0-linux-arm-pi.tar。广州——带= 1

That's it. You can confirm it's there by checking the node version with:

就是这样。你可以通过以下节点版本来确认它的存在:

node -v 

and:

和:

npm -v

The actual url to get the files for node will change as the version changes, you can always see the list of files available for download here: http://nodejs.org/download/

获取节点文件的实际url将随着版本的更改而更改,您总是可以在这里看到可下载的文件列表:http://nodejs.org/download/

All these instructions came from: http://www.robert-drummond.com/2015/01/08/server-side-javascript-on-a-raspberry-pi-how-to-install-node-js-2/

所有这些指令都来自:http://www.robert-drummond.com/2015/01/08/server-side-javascript-on- raspberrypi -how- install-node-js-2/

#2


8  

Alternatively you can upgrade your GCC to V4.8 for this package to work!

或者,您也可以将GCC升级到V4.8,以使这个包生效!

Option 1 (the better option):

sudo apt-get update
sudo apt-get install gcc-4.8 g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50

Options 2: Upgrade to Debian Jessie

Replace all instances of "wheezy" in /etc/apt/sources.list

替换/etc/apt/sources.list中的所有“wheezy”实例

sudo apt-get update
sudo apt-get dist-upgrade

After this you download the Node.js using command line as follows:

然后下载节点。js使用命令行如下:

wget http://node-arm.herokuapp.com/node_latest_armhf.deb

Next step is to install the Node.js:

下一步是安装Node.js:

sudo dpkg -i node_latest_armhf.deb

Finally, you can verify the installation:

最后,您可以验证安装:

node -v

These instructions are mentioned on http://node-arm.herokuapp.com/

这些说明是在http://nodearm.herokuapp.com/上提到的。

#3


6  

That runs for me: http://blog.wia.io/installing-node-js-v4-0-0-on-a-raspberry-pi/

这对我来说是一个问题:http://blog.wia.io/installationnodejs-v4-00-0:)

Raspberry Pi Model A, B, B+ and Compute Module

覆盆子Pi模型A, B, B+和计算模块

wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv6l.tar.gz
tar -xvf node-v4.0.0-linux-armv6l.tar.gz
cd node-v4.0.0-linux-armv6l

Raspberry Pi 2 Model B

树莓派2型B型

wget https://nodejs.org/dist/v4.0.0/node-v4.0.0-linux-armv7l.tar.gz
tar -xvf node-v4.0.0-linux-armv7l.tar.gz
cd node-v4.0.0-linux-armv7l
sudo cp -R * /usr/local/

#4


1  

use nodejs instead of node

使用nodejs代替节点

sudo apt-get update && sudo apt-get install nodejs

sudo apt-get update & sudo apt-get install nodejs

for npm

对于npm

sudo apt-get install npm

sudo apt-get安装npm

#5


0  

The Latest Node is released for the below platforms, which helped for my old R-PI which is of model name : ARMv6-compatible processor rev 7 (v6l)

最新的节点发布在下面的平台上,这对我以前的R-PI有所帮助,它的型号是:armv6兼容的处理器rev7 (v6l)

https://nodejs.org/download/release/v4.1.0/

https://nodejs.org/download/release/v4.1.0/

node-v4.1.0-linux-arm64.tar.gz 17-Sep-2015 04:24 10886090

node-v4.1.0-linux-arm64.tar。广州17 - 9 - 2015 04:24 10886090

node-v4.1.0-linux-arm64.tar.xz 17-Sep-2015 04:24 7100824

node-v4.1.0-linux-arm64.tar。xz 17 - 9 - 2015 04:24 7100824

node-v4.1.0-linux-armv6l.tar.gz 17-Sep-2015 17:37 10763504

node-v4.1.0-linux-armv6l.tar。广州17 - 9 - 2015 17:37 10763504

node-v4.1.0-linux-armv6l.tar.xz 18-Sep-2015 00:15 7005048

node-v4.1.0-linux-armv6l.tar。今日xz 18 - 2015年9月——7005048

node-v4.1.0-linux-armv7.tar.gz 17-Sep-2015 05:17 10773951

node-v4.1.0-linux-armv7.tar。广州17 - 9 - 2015 05:17 10773951

node-v4.1.0-linux-armv7.tar.xz 17-Sep-2015 05:18 7004760

node-v4.1.0-linux-armv7.tar。xz 17 - 9 - 2015 05:18 7004760

node-v4.1.0-linux-armv7l.tar.gz 18-Sep-2015 12:58 10773951

node-v4.1.0-linux-armv7l.tar。广州18 - 9月- 2015年12:58 10773951

#6


-1  

You can try the following command: wget node-arm.herokuapp.com/node_archive_armhf.deb

您可以尝试以下命令:wget node-arm.herokuapp.com/node_archive_armhf.deb

then sudo dpkg -i node_archive_armhf.deb

然后sudo dpkg -i node_archive_armhf.deb

node -v should work now!

节点-v现在应该可以工作了!