× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Re: Building Nodejs on ReadyNas

dacarson
Aspirant

Building Nodejs on ReadyNas

After many attempts, I was finally able to build Node on my ReadyNas. 

 

For those who are trying to do this, I basically followed instructions here:

http://elsmorian.com/post/23474168753/nodejs-on-raspberry-pi

 

Rather than the old Node version mentioned in the URL above, I checked out a newer version:

 

$ git checkout v10.15.0

 

 

Doing a little research, I found that the ReadyNas that I have, has a ARM Cortex A15. This CPU has an ARMv7-A architecture, so I entered the following lines into the shell:

 

$ export CCFLAGS='-march=armv7-a'
$ export CXXFLAGS='-march=armv7-a'

 

I tried building everything and found that I had to comment out one line, which I think impacts debugging. In the file:

deps/v8/src/base/platform/platform-posix.cc

There are these lines:

 

void OS::DebugBreak() {
#if V8_HOST_ARCH_ARM
  //asm("bkpt 0");
#elif V8_HOST_ARCH_ARM64

I had to add the '//' to the asm line

 

 

Then kicking off the build:

 

$ ./configure
$ make
$ make install

 

The "make" took a long time, aka almost 2 hours. After it was built and installed, it was all there:

root@ReadyNas:~# node -v

v10.15.0

root@ReadyNas:~# npm -v

6.4.1

 

Message 1 of 8
JohnCM_S
NETGEAR Employee Retired

Re: Building Nodejs on ReadyNas

Hi dacarson,

 

Welcome to the Community!

 

Thank you for sharing this information. We appreciate your contribution to the community.

 

Feel free to post any suggestions, questions, recommendations or anything about your NAS that you think needs attention or will help others.

 

Regards,

Message 2 of 8
DMod
Tutor

Re: Building Nodejs on ReadyNas

Can you please go into greater details how you were able to get this to work?

I've been looking all over trying to get this set up and you're the first person I've seen who was sucessfull.

Thank you so much in advance

Message 3 of 8
dacarson
Aspirant

Re: Building Nodejs on ReadyNas

I can help you out with getting it to compile. Can you tell me which part of the instructions I point to are not working?

Message 4 of 8
DMod
Tutor

Re: Building Nodejs on ReadyNas

Are you compiling it on the NAS or on your computer then transfering it over to install?

 

I was having trouble typing out

$ git checkout v10.15.0

so I just downloaded the files onto my computer.  I entered

$ export CCFLAGS='-march=armv7-a'
$ export CXXFLAGS='-march=armv7-a'

like you said and commented out the line in the code. When trying to run make I'm getting this error but I'm running make on my computer.

node/node-master/out/Release/obj.target/icuucx/deps/icu-small/source/common/uniset_props.o.d.raw  -march=armv7-a -c
../deps/icu-small/source/common/uniset_props.cpp:1:0: error: bad value (armv7-a) for -march= switch
 // © 2016 and later: Unicode, Inc. and others.
 ^
tools/icu/icuucx.target.mk:290: recipe for target '/home/m/node/node-master/out/Release/obj.target/icuucx/deps/icu-small/source/common/uniset_props.o' failed
make[1]: *** [/home/m/node/node-master/out/Release/obj.target/icuucx/deps/icu-small/source/common/uniset_props.o] Error 1
Makefile:99: recipe for target 'node' failed
make: *** [node] Error 2

 

I'm logged in as root through ssh. What steps do I now take? Is there a reason why not installing it through apt instead?

Message 5 of 8
dacarson
Aspirant

Re: Building Nodejs on ReadyNas

I am compiling it on the NAS. It isn't fast, but that seemed better for me as I didn't want to mess with cross-compiling on another computer.

 

I checked out the code directly onto the ReadyNAS. To do this I installed the git tools as well as other libraries needed for building node:

apt-get install git-core build-essential libssl-dev 

then cloned the repo:

git clone https://github.com/nodejs/node

then updated to the particular version:

cd node
git checkout v10.15.0

Then started the build:

./configure
make

You'll get this error:

  g++ -o /root/node/out/Release/obj.host/v8_libbase/deps/v8/src/base/platform/platform-posix.o ../deps/v8/src/base/platform/platform-posix.cc '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=0' '-DV8_TARGET_ARCH_ARM' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DV8_EMBEDDER_STRING="-node.45"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DV8_INTL_SUPPORT' '-DV8_CONCURRENT_MARKING' '-DDISABLE_UNTRUSTED_CODE_MITIGATIONS' -I../deps/v8  -pthread -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -mfpu=vfp -marm -fdata-sections -ffunction-sections -O3 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF /root/node/out/Release/.deps//root/node/out/Release/obj.host/v8_libbase/deps/v8/src/base/platform/platform-posix.o.d.raw   -c
/tmp/cc5aW9sQ.s: Assembler messages:
/tmp/cc5aW9sQ.s:994: Error: selected processor does not support ARM mode `bkpt 0'
deps/v8/gypfiles/v8_libbase.host.mk:129: recipe for target '/root/node/out/Release/obj.host/v8_libbase/deps/v8/src/base/platform/platform-posix.o' failed
make[1]: *** [/root/node/out/Release/obj.host/v8_libbase/deps/v8/src/base/platform/platform-posix.o] Error 1
Makefile:99: recipe for target 'node' failed
make: *** [node] Error 2

so I commented out the line that had 'bkpt 0' 

and then kick off make again and wait... it takes a long time

 

re:  Is there a reason why not installing it through apt instead?

I would install it via apt but AFAIK it is not available for ReadyNAS

 

 

 

 

Message 6 of 8
DMod
Tutor

Re: Building Nodejs on ReadyNas

I was having problems with the system not realizing that it was installed but I was able to install npm and node.js with apt.

Thank you for taking the time to write out the way you installed it, I think I'm going to remove it and go the way you said instead.
Message 7 of 8
givememynamebak
Luminary

Re: Building Nodejs on ReadyNas

Don't you just have to add its location in your PATH?  

Message 8 of 8
Top Contributors
Discussion stats
  • 7 replies
  • 3145 views
  • 0 kudos
  • 4 in conversation
Announcements