Moving SD card from Pi3 to PiZero

#1

I did all my development on a Pi3 and then stuck the card into a PiZero and got this

pi@kitchencheer2:~/.node-red $ node-red
Illegal instruction

and then remembered you couldn't just do that as it needs sorting out to run on the older ARM chip in the PiZero

So I ran the standard Pi bash update script thinking this would sort it out but got this

This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED                       ✔
  Remove old version of Node-RED      ✔
  Remove old version of Node.js       -
  Update Node.js LTS                  ✘   Failed to install Node.js - Exit
  Clean npm cache                     
  Install Node-RED core               
  Move global nodes to local          
  Install extra Pi nodes              
  Npm rebuild existing nodes          
  Add menu shortcut                   
  Update systemd script               
                                      

Any errors will be logged to   /var/log/nodered-install.log

:frowning:
any suggestions? (short of setting up the PiZero from scratch )
Simon

#2

Did you npm install again ?

#3

Between, I use this to install node 8.x on the zero:

1 Like
#4

Easiest way is to remove both the node command and the update repository then re-run the script...

sudo rm /usr/bin/node
sudo rm -r /etc/apt/sources.list.d/nodesource.list
sudo apt-get update

then re-run the update bash command.

1 Like
#5

looking promising

pi@kitchencheer2:~ $ sudo rm /usr/bin/node
pi@kitchencheer2:~ $ sudo rm -r /etc/apt/sources.list.d/nodesource.list
pi@kitchencheer2:~ $ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]               
Get:4 http://archive.raspberrypi.org/debian stretch/main armhf Packages [173 kB]                   
Get:5 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [34.3 kB]                                                  
Fetched 11.9 MB in 44s (266 kB/s)                                                                                                                         
Reading package lists... Done
pi@kitchencheer2:~ $ bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
...    Running Node-RED update for user pi at /home/pi

This can take 20-30 minutes on the slower Pi versions - please wait.

  Stop Node-RED                       ✔
  Remove old version of Node-RED      ✔
  Remove old version of Node.js       ✔
  Install Node.js for Armv6           ✔   Node v8.11.4   Npm 5.6.0
  Clean npm cache                     ✔
  Install Node-RED core               
  Move global nodes to local          
  Install extra Pi nodes              
  Npm rebuild existing nodes          
  Add menu shortcut                   
  Update systemd script               
                                      

Any errors will be logged to   /var/log/nodered-install.log
#6

Yippee
Stop Node-RED :heavy_check_mark:
Remove old version of Node-RED :heavy_check_mark:
Remove old version of Node.js :heavy_check_mark:
Install Node.js for Armv6 :heavy_check_mark: Node v8.11.4 Npm 5.6.0
Clean npm cache :heavy_check_mark:
Install Node-RED core :heavy_check_mark: 0.19.2
Move global nodes to local -
Install extra Pi nodes -
Npm rebuild existing nodes :heavy_check_mark:
Add menu shortcut :heavy_check_mark:
Update systemd script :heavy_check_mark:
id=Node-RED.desktop

All working fine :slight_smile:

1 Like