-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation notes for AlexaCookieNode.js - issues with old nodejs/npm versions? #2
Comments
Another way to avoid the need to run as root/sudo would be to change the ports from 81 & 82 to something above the 1024 boundary. 8081 & 8082 would work. Recommend default config and documentation go to values above 1024. |
More thoughts on documentation / troubleshooting. Not sure how much of this needs to go in the documentation, but I thought I should capture this so that it could be referenced by others who are just starting on their install work... These apply to raspbian (/debian) running systemd, but any system that uses systemd version 229 or greater can follow this method. It assumes you have sudo rights. Handy references: Run After running the previously documented Run the Run Tips:
Once it is running sanely, then stop it. Yep counter-intuitive, but that allows solving one class of problem before possibly introducing another. Stop it by running Edit the pm2-pi.service file with
Save and exit. Run Run Check If you want to verify that the restart happens every MaxSec, you can go back a few steps, edit the value to something like 60, repeat the steps and watch to see if the restart is happening every 60 seconds. Because the restart is a clean one, the 4th column in the pm2 status report should remain as 0, however the PID from the If you see a message Then of course go back one more time and set it to a larger value. |
Since many people may be doing this on a Raspberry Pi, and the nodejs is very old (version 8 at this time), and so is the npm in the archive.raspberrypi.org here are some things to consider:
If you get an error with the
npm install -g pm2
sudo npm install -g npm@latest
# this will update npm (with some warnings)sudo npm install -g pm2
# this will allow you to change files in shared areas.Between the pm2 startup and the pm2 save commands you might need to run:
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
Still a work in progress for me, since pm2 is restarting AlexaCookie every couple of seconds (based on pid changes in
pm2 status
). However I wanted to capture the troubleshooting so far...Also had to change the package.json to read:
"dependencies": {
"alexa-cookie2": "https://github.com/Apollon77/alexa-cookie",
rather than:
github:Appolon77/alexa-cookie.
Still no luck in getting server to run... possibly need newer version of nodejs? Still investigating.
and I'm guessing that the problem is that the pm2 commands to start the server need to be
sudo pm2 ...
Since this server config is running on a low port (<1024), the normal pi user can't do that...
Hopefully these notes will help others in getting their configs sorted out.
The text was updated successfully, but these errors were encountered: