1

I've tried several different methods of installing nodejs and they all fail. The latest one I've tried is the steps here: https://learn.adafruit.com/node-embedded-development/installing-node-dot-js

While running sudo apt-get install node it tries Processing triggers for man-db. At this point it will suddenly crash and outputs several lines that are similar to this one:

dpkg: error while cleaning up: unable to remove newly-extracted version of <file url>: Read-only file system.`

At some point during this crash I'll get memory errors like this one: `Unable to allocate memory

It will then pause and output another error message:

Problem executing scripts DPkg::Post-Invoke '/usr/bin/test -e \
  /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && \
  /usr/bin/test -S /var/run/dbus/system_bus_socket && \
  /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit \
    --object-path /org/freedesktop/PackageKit --timeout 4 \
    --method org.freedesktop.PackageKit.StateHasChanged cache-update > \
  /dev/null: /bin/echo > /dev/null'

Lastly it will output:

E: Sub-process returned an error code

And then quit. At this point I believe the OS is totally corrupted. For example, typing ls into the console now outputs the error:

bash: ls: command not found

Sometimes the bar at the top will disappear and the background will turn white. Other times it will suggest I enter recovery mode where it will launch NOOBS again.

At this point I usually unplug my SD card and re-image it before putting it back in, trying a different method, and ending with the same result.

I've also tried the steps at a few other different sites including:

  1. http://weworkweplay.com/play/raspberry-pi-nodejs/
  2. http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/

They all end the same way and I have to re-image and try again.

Some more details

  • I'm imaging my SD card using Disk Utility on Mac OS. I change the format to MS-DOS (FAT) and the Scheme I leave at "Master Boot Record". Then I copy the contents of NOOBS to the SD card, insert it into my Pi, and install Raspbian
  • My Pi is a Raspberry Pi 3 Model B V1.2
  • My SD card is made by Lexar and is 16GB
1

One of the problem about those online tutorials is that they are obsoleted and never bother to update it, and many tutorials were prior nodejs has the official binary package for ARM CPU which Raspberry Pi used. Please take a look at this link for the correct installation.

Please noted that the link does not refer to the latest available binary, please visit the official download page of nodejs, and right click on ARMv7 for Raspberry Pi 2 and 3 (or ARMv6 for older Raspberry Pi) to copy the link and replace it with the commands that refer to the early version of nodejs.

  • It works! You're awesome :D – Ben Lorantfy Jul 8 '17 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.