I just moved from an old Mac mini to the M1 Mac mini 2020 by doing a Time Machine restore using the backup of the old Mac mini. I realize that by doing so, I have transferred a lot of intel code, but thanks to Rosetta everything appears to be working. I can connect with an external browser to Node-RED and everything looks good to the point that I do not know how to stop/start Node-RED via the terminal.
When I enter "node-red-stop" it comes back with "zsh: command not found: node-red-stop".
The terminal has now changed from bash to zsh and obviously tries to find Node-RED at a different location from where it was on my old Intel Mac mini.
"which node-red" returns "/usr/local/bin/node-red".
After already spending far too much time getting homebrew and influxdb@1 installed for M1 native code, I thought I better ask the community whether I should also try to upgrade node.js + Node-RED and if so whether there are online instructions on how to do it. I could not find any.
Should I decide to stay with the intel code, I guess I need to modify .zprofile and/or .zshrc in order to be able to do node-red-stop/-start/-log? but how?
thank you for your help,
greetings from freezing Bavaria
you are right, i confused it with my other node-red raspberry pi installations and forgot that on my Mac mini I had installed PM2 as outlined in Starting Node-RED on boot : Node-RED
so I can stop/start with "pm2 stop node-red" and "pm2 start node-red"
This leaves my question open whether it would be beneficial to upgrade node.js + node-red to M1 native code.
If you move to the ARM build of NodeJS you can rebuild any native components of the installed nodes by running npm rebuild in the Node-RED userDir (normally ~/.node-red but logged at startup)
You would also want to re-run sudo npm install -g --unsafe-perm node-red to make sure that things like bcrypt get rebuilt as well for best performance as well as any of the other core components.