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:
- http://weworkweplay.com/play/raspberry-pi-nodejs/
- 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