NOTE: This post refers to Node v0.8.x. For new v0.10.x please visit this.
In my previous post I’ve described how to install Node v.0.6.19 into your Fox Board G20. Now I will show how to install the “fresh” 0.8 release of Node. For the identical steps please visit this.
-
Step 1 to step 4
The same as this.
-
Step 5: download Node source code
To download Node source code simply use customized nvm:
1debarm:~$ nvm download v0.8.0 -
Step 6: customize SConstruct file
After a while you have the Node source code and you must customize the v8 script:
1debarm:~$ nano ~/nvm/src/node-v0.8.0/deps/v8/SConstruct818283848586878889'gcc': {'all': {'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'],},'visibility:hidden': {# Use visibility=default to disable this.'CXXFLAGS': ['-fvisibility=hidden']},and modify as follow:
818283848586878889'gcc': {'all': {'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS', '-march=armv5tej', '-mthumb-interwork'],'CXXFLAGS': ['-fno-rtti', '-fno-exceptions', '-march=armv5tej', '-mthumb-interwork'],},'visibility:hidden': {# Use visibility=default to disable this.'CXXFLAGS': ['-fvisibility=hidden']},and finally this:
160161162163164165166167168'armeabi:softfp' : {'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],'vfp3:on': {'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']},'simulator:none': {'CCFLAGS': ['-mfloat-abi=softfp'],}},in this one:
160161162163164165166167168'armeabi:softfp' : {'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],# 'vfp3:on': {# 'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']# },'simulator:none': {'CCFLAGS': ['-mfloat-abi=soft'],}}, -
Step 7: customize common.gypi
By default the v8 installer recognize the Fox Board as an armv7, but isn’t right (see this).
Edit common.gypi:
1debarm:~$ nano ~/nvm/src/node-v0.8.0/deps/v8/build/common.gypyand change this:
30313233343536{'variables': {'use_system_v8%': 0,'msvs_use_common_release': 0,'gcc_version%': 'unknown','v8_compress_startup_data%': 'off','v8_target_arch%': '<(target_arch)',as follow:
303132333435363738{'variables': {'armv7%': 0,'arm_neon%': 0,'use_system_v8%': 0,'msvs_use_common_release': 0,'gcc_version%': 'unknown','v8_compress_startup_data%': 'off','v8_target_arch%': '<(target_arch)', -
Step 8: customize macro-assembler-arm.cc
As workaround for “For thumb inter-working we require an architecture which supports blx” error message during v8 compilation, you must customize macro-assembler-arm.cc source code:
1debarm:~$ nano ~/nvm/src/node-v0.8.0/deps/v8/src/arm/macro-assembler-arm.ccfrom this:
616263646566// We do not support thumb inter-working with an arm architecture not supporting// the blx instruction (below v5t). If you know what CPU you are compiling for// you can use -march=armv7 or similar.#if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS)# error 'For thumb inter-working we require an architecture which supports blx'#endifto this:
303132333435// We do not support thumb inter-working with an arm architecture not supporting// the blx instruction (below v5t). If you know what CPU you are compiling for// you can use -march=armv7 or similar.// #if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS)// # error 'For thumb inter-working we require an architecture which supports blx';// #endif -
Step 9: install Node
Now use again nvm:
1debarm:~$ nvm foxinstall v0.8.0After a few hours (be patient!) you have compiled the latest Node version and you must use it:
1debarm:~$ nvm use v0.8.0Done! Now you can verify all:
12debarm:~$ node -vdebarm:~$ npm -vIf all versions appear, you can install your desired Node packages using npm as you know:
1debarm:~$ npm install expressYou can also set the default Node version as follow:
1debarm:~$ nvm alias default v0.8.0
Good programming with Node!
Arm , Node.js
About Marcello Gesmundo
I'm the founder of Yoovant company. I'm an engineer and an artist: what could be better than combine the technologies with the arts?

Email:
Phone: +39 0287366648
Fax: +39 08321785128
Do you know whether these instructions would also apply for the Raspberry Pi?
Hi Rob,
I don’t have a Raspberry Pi to try (sorry), but for his processor, you can avoid step 7 and check your cpuinfo:
and change step 6 accordingly. For example, if your cpu doesn’t have thumb feature and shows ARM11 as cpu architecture, you can use:
If you have some difficulty please copy and paste here your cpuinfo result.
Marcello