Setting up and running a time-zone-server on Raspberry pi

More
7 months 3 weeks ago #12270 by Jedidiah
So far, no luck. So I reinstalled Raspberry Pi OS, and did the following:

Installed NVM:
curl -o- raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

Reran Profile script to start NVM
source ~/.bashrc

Then proceeded per Ian's instructions at:
github.com/isparkes/time-zone-server

When I get to the part about testing the installation, I get this:
pi@raspberrypi:~ $ node -v
-bash: node: command not found
pi@raspberrypi:~ $ npm -v
-bash: npm: command not found

Would greatly appreciate your guidance!

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago #12271 by Ian
I think you have to invoke nvm to set up the npm version:
nvm intstall lts/carbon
nvm use lts/carbon

Then you might be able to follow the instructions for the rest.

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago #12272 by Ian

Ty_Eeberfest wrote: ...I want to do things right.


I think the crontab way is pretty clean. It allows you to associate processes with users (even root if you need), and is an obvious place to look if you need to find out how a process started, and by whom. In 6 months, you won't remember where it is, and you'll go crazy searching for it.

Putting it in startup scripts down in the heart of the shell launch process works, but is not that easy to find or keep track of.

The other way would be to start it as a system service, this is also pretty easy to do - you just need to have a launcher script to start/stop/restart the service. This got a whole lot easier with systemd:

www.raspberrypi.org/documentation/linux/usage/systemd.md

(but was still more effort than the "@reboot" crontab entry).

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago #12273 by Jedidiah
Got through the rest of your instructions, but the server is not running. See below. I think I am missing "express". Any special guidance to install it?

pi@raspberrypi:~/time-zone-server $ cat log.txt
module.js:550
throw err;
^

Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/pi/time-zone-server/time-zone-service.js:3:15)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago - 7 months 3 weeks ago #12274 by Ty_Eeberfest
Express error looks familiar. Seems to me I had to get express frpm
expressjs.com/en/starter/installing.html

It's been a while so my memory isn't great, but I think once you get express installed you'll get another missing dependency for something called "time". Pretty sure you just need to make a directory ~/time-zone-server/node_modules/time and then, while in that directory, say: $ npm install time

Edit: Corrected directory from "modules" to "node_modules"

Look into it later when the dust is clearing off the crater.
Last edit: 7 months 3 weeks ago by Ty_Eeberfest.

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago #12275 by Ian
Did you do
npm install

and did that make a directory "node_modules"?

Please Log in or Create an account to join the conversation.

Moderators: AccutronTy_EeberfestIan
Time to create page: 0.106 seconds
Go to top
JSN Boot template designed by JoomlaShine.com