- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Building Nodejs on ReadyNas
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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,
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Building Nodejs on ReadyNas
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.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Building Nodejs on ReadyNas
Don't you just have to add its location in your PATH?