[Cubieboard] Installing node. js and NPM on Cubieboard

Source: Internet
Author: User

You have two options to implement the installation of Nodejs on Cubieboard, download other people have compiled the Nodejs binary package for Cubieboard, or download the source code on their own to compile on the Cubieboard.

Using a compiled binary package

Download node. js for ARM architecture Here, if you can't find the resources in the Cubieboard community, you can find similar resources in the Raspberrypi community. For example, "node. js installation for Raspberry Pi" The article provides the latest node. JS executable package download for Raspberrypi, which also provides executable binary package downloads, but be aware that the chips they are targeting are not necessarily suitable for Cubieboard2, but it is worth trying and broadening your mind.

Install node. js from Source package compilation

(This article takes Beaglebone as an example)

Instead of using Cross-complie to compile executable packages for the ARM architecture, you can compile directly on Cubieboard (the original is compiled on Beaglebone, this article compiles on Cubieboard Lubuntu). But doing so consumes a little longer.

Please use sudo or su to switch to root permissions when compile and install.

The first step: getting Ready for work

First you need a compiler to compile the Nodejs source code. The build process requires Python to handle some configuration files, and GCC is required to handle the actual source code.

Install python# Apt Install build-essential

Step Two: Download node source code

Download the latest source code from the node. JS website. As of this writing, the latest version of Nodejs is 0.10.28 (originally 0.10.5). This article extracts the source package directly to the current folder, you can use the-C <path> option to specify the decompression path.

wget http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gztar xzvf node-v0. 10.28. tar. gz

Step Three: Configure

By the time the text is down, Google's V8 engine snapshot function will cause node to occur segmentation fault. Snapshotting can help node start at a faster speed, but this is not an important feature, so it can be ignored at compile time.

# CD Node-v0. 10.28 # . /configure--without-snapshot

Printed configuration results:

{'Target_defaults': {'Cflags': [],                       'default_configuration':'Release',                       'defines': [],                       'Include_dirs': [],                       'Libraries': []},  'variables': {'ARM_FPU':'Vfpv3',                 'Arm_neon':0,                 'armv7':1,                 'clang':0,                 'gcc_version': $,                 'Host_arch':'Arm',                 'NODE_INSTALL_NPM':'true',                 'Node_prefix':"',                 'Node_shared_cares':'false',                 'Node_shared_http_parser':'false',                 'NODE_SHARED_LIBUV':'false',                 'Node_shared_openssl':'false',                 'NODE_SHARED_V8':'false',                 'Node_shared_zlib':'false',                 'Node_tag':"',                 'node_unsafe_optimizations':0,                 'Node_use_dtrace':'false',                 'NODE_USE_ETW':'false',                 'Node_use_openssl':'true',                 'node_use_perfctr':'false',                 'Node_use_systemtap':'false',                 'python':'/usr/bin/python',                 'Target_arch':'Arm',                 'V8_enable_gdbjit':0,                 'v8_no_strict_aliasing':1,                 'v8_use_arm_eabi_hardfloat':'true',                 'V8_use_snapshot':'false'}}creating./config.gypicreating./config.mk

Fourth Step: Compiling

Start compiling, the compilation time is about 30-40 minutes.

Make

Fifth step: Verify that the compilation is successful

When build is complete, we can confirm that the compilation was successful before installing.

' console.log ("Hello, World"); ' # . /node-v

This article confirms that the node version number can be printed correctly, but the node command cannot be executed, and the same situation appears on NPM.

Sixth Step: Install

 Make Install

If it is already installed, you can uninstall it using make uninstall.

Conclusion

Since the natively compile on Cubieboard was unsuccessful, the "node. js installation for Raspberry Pi" was used The precompiled files provided in this article successfully installed NodeJS-0.10.28 and npm-1.4.9 on Cubieboard2.

1. Download the installation package

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

This article Nodejs the latest version of 0.10.28, so the version was downloaded.

2. Installation

sudo dpkg-i node_0. 10.28-165570  files and directories currently installed.) Unpacking node (from Node_0. 10.28-1_armhf.deb) ... Setting up node (0.10. 1forMans-db ...

3. Verification

' console.log ("Hello, World"); '  -vv0. 10.28  -v1.4. 9

Reference: node. js for the Beaglebone Black

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.