linuxnode.jsnpmdebianapt-get

Installing nodejs and npm on WDMyCloud server


I'd like to install nodejs and npm on my WDMyCloud server, but I'm having problems doing so. The server itself is running Debian GNU/Linux 7 (wheezy).

I'm able to run sudo apt-get install nodejs without error, but upon running the command I'm presented with the following message:

nodejs: error while loading shared libraries: libcares.so.2: ELF load command alignment not page-aligned

And when trying to run sudo apt-get install npm, it doesn't successfully install:

The following packages have unmet dependencies:
 npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Solution

  • The WDMYCLOUD v4 firmware uses 64K pagesize (while v3 uses common 4k pagesize) to increase I/O speed. All softwares in the built-in Debian repository were built for 4k pagesize and are broken for use now. The error you saw exactly complained about that.

    Refer to: https://community.wd.com/t/why-pagesize-64k-in-firmware-v4/94868

    As workarounds, you can:

    1. Build 64k softwares by your own (the ridiculous official suggestion)
    2. Use some other people's reporsity (at your own risk). For me, I'm using https://community.wd.com/t/repository-with-software-worked-on-v4-firmware/94532. Its ffmpeg works well so far so good.
    3. Downgrade the firmware to V3

    Regarding Nodejs, I'm also a big fan of it but I didn't try out to build "it" by my own because it seems a lot of effort -- besides the nodejs and npm, we probably have to rebuild packages provided by npm. So I gave up on the cool idea of running nodejs on WDMYCLOUD.

    If someone someday makes it, please let us know and we'd appreciate that!