Email Notifications Driver using Node/sendmail on a PI

Arg,,, sorry

sudo systemctl restart "servicename"

need the "sudo" in there I think..

Unfortunately, same error:
root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff# systemctl restart DoNetStuff
root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff# node app.js
Created route: /email for controllers/email/index.js
events.js:183
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE :::3000
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at Function.listen (/home/pi/Hubitat-DoNS/DoNetStuff/node_modules/express/lib/application.js:618:24)
at Object. (/home/pi/Hubitat-DoNS/DoNetStuff/app.js:17:5)
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)
root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff#

yeah the service is not running.. do you have anything else running on that pi?

I've got cast-web-api.
and ssmtp.

root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff# ps -A
PID TTY TIME CMD
1 ? 00:00:05 systemd
2 ? 00:00:00 kthreadd
4 ? 00:00:00 kworker/0:0H
6 ? 00:00:00 mm_percpu_wq
7 ? 00:00:05 ksoftirqd/0
8 ? 00:06:13 rcu_sched
9 ? 00:00:00 rcu_bh
10 ? 00:00:00 migration/0
11 ? 00:00:00 cpuhp/0
12 ? 00:00:00 cpuhp/1
13 ? 00:00:00 migration/1
14 ? 00:00:00 ksoftirqd/1
16 ? 00:00:00 kworker/1:0H
17 ? 00:00:00 cpuhp/2
18 ? 00:00:00 migration/2
19 ? 00:00:00 ksoftirqd/2
21 ? 00:00:00 kworker/2:0H
22 ? 00:00:00 cpuhp/3
23 ? 00:00:00 migration/3
24 ? 00:00:00 ksoftirqd/3
26 ? 00:00:00 kworker/3:0H
27 ? 00:00:00 kdevtmpfs
28 ? 00:00:00 netns
33 ? 00:00:00 khungtaskd
34 ? 00:00:00 oom_reaper
35 ? 00:00:00 writeback
36 ? 00:00:00 kcompactd0
37 ? 00:00:00 crypto
38 ? 00:00:00 kblockd
39 ? 00:00:00 watchdogd
40 ? 00:00:00 rpciod
41 ? 00:00:00 xprtiod
44 ? 00:00:01 kswapd0
45 ? 00:00:00 nfsiod
55 ? 00:00:00 kthrotld
56 ? 00:00:00 iscsi_eh
57 ? 00:00:00 dwc_otg
58 ? 00:00:00 DWC Notificatio
59 ? 00:00:00 vchiq-slot/0
60 ? 00:00:00 vchiq-recy/0
61 ? 00:00:00 vchiq-sync/0
62 ? 00:00:00 vchiq-keep/0
63 ? 00:00:00 SMIO
65 ? 00:00:00 irq/92-mmc1
67 ? 00:00:24 mmcqd/0
68 ? 00:00:07 jbd2/mmcblk0p2-
69 ? 00:00:00 ext4-rsv-conver
70 ? 00:00:00 ipv6_addrconf
84 ? 00:00:00 kworker/2:1H
87 ? 00:00:04 systemd-journal
124 ? 00:00:00 systemd-udevd
141 ? 00:00:00 irq/169-usb-001
212 ? 00:00:00 cfg80211
217 ? 00:00:00 brcmf_wq/mmc1:0
218 ? 00:00:00 brcmf_wdog/mmc1
275 ? 00:00:00 systemd-timesyn
298 ? 00:00:01 dbus-daemon
332 ? 00:00:00 wpa_supplicant
333 ? 00:00:00 rsyslogd
334 ? 00:00:00 cron
337 ? 00:00:00 systemd-logind
346 ? 00:00:43 avahi-daemon
348 ? 00:00:01 thd
376 ? 00:00:00 kworker/3:1H
377 ? 00:00:00 avahi-daemon
407 ? 00:00:00 lightdm
408 ? 00:00:00 kworker/0:1H
428 tty1 00:00:00 agetty
459 ? 00:00:00 xrdp-sesman
506 ? 00:00:00 sshd
508 ? 00:00:00 xrdp
521 ? 00:00:00 colord
524 tty7 00:00:40 Xorg
556 ? 00:00:04 nmbd
579 ? 00:00:00 lightdm
587 ? 00:00:00 systemd
590 ? 00:00:00 (sd-pam)
595 ? 00:00:03 lxsession
604 ? 00:00:00 dbus-daemon
619 ? 00:00:00 kworker/u9:0
620 ? 00:00:00 hciattach
625 ? 00:00:00 kworker/u9:1
633 ? 00:00:00 bluetoothd
668 ? 00:00:00 bluealsa
693 ? 00:00:00 krfcommd
723 ? 00:00:00 ssh-agent
728 ? 00:00:00 kworker/1:1H
731 ? 00:00:00 gvfsd
736 ? 00:00:00 gvfsd-fuse
754 ? 00:00:00 openbox
757 ? 00:00:00 lxpolkit
759 ? 00:03:32 lxpanel
760 ? 00:00:01 pcmanfm
768 ? 00:00:00 ssh-agent
773 ? 00:00:00 polkitd
779 ? 02:01:21 PM2 v3.5.0: God
780 ? 00:00:04 PM2 v3.5.0: God
803 ? 00:00:00 smbd
804 ? 00:00:00 smbd-notifyd
805 ? 00:00:00 cleanupd
808 ? 00:00:00 gvfs-udisks2-vo
811 ? 00:00:00 lpqd
813 ? 00:00:00 udisksd
820 ? 00:00:00 menu-cached
826 ? 00:00:00 gvfs-goa-volume
832 ? 00:00:00 gvfs-afc-volume
834 ? 00:00:00 sh
843 ? 00:00:00 gvfs-gphoto2-vo
847 ? 00:00:00 gvfs-mtp-volume
874 ? 00:00:00 gvfsd-trash
905 ? 00:20:41 node /home/pi/a
2337 ? 00:00:00 xrdp-sessvc
2338 ? 00:00:00 xrdp-sesman
2339 ? 00:01:58 Xorg
2348 ? 00:00:03 lxsession
2351 ? 00:00:00 xrdp-chansrv
2408 ? 00:00:00 ssh-agent
2418 ? 00:00:06 openbox
2423 ? 00:03:44 lxpanel
2424 ? 00:00:28 pcmanfm
2431 ? 00:00:00 ssh-agent
2449 ? 00:00:00 menu-cached
2456 ? 00:00:00 sh
4224 ? 00:00:00 leafpad
5956 pts/0 00:00:00 sudo
5960 pts/0 00:00:00 su
5973 pts/0 00:00:00 bash
7246 ? 00:00:00 kworker/u8:0
7929 ? 00:00:00 kworker/u8:1
8415 ? 00:00:00 kworker/2:1
8525 ? 00:00:00 kworker/3:0
10320 ? 00:00:00 kworker/1:0
11660 ? 00:00:01 packagekitd
11672 ? 00:00:00 sendmail-mta
12677 ? 00:00:00 kworker/2:0
12780 ? 00:00:00 kworker/1:1
12951 ? 00:00:00 kworker/0:1
14594 ? 00:00:00 sendmail-mta
14824 ? 00:00:00 kworker/0:0
14825 ? 00:00:00 kworker/3:2
15654 ? 00:00:00 cupsd
15655 ? 00:00:00 cups-browsed
15861 ? 00:00:00 kworker/1:2
16162 ? 00:00:00 kworker/2:2
16341 ? 00:00:06 sendmail-mta
16780 ? 00:00:00 kworker/0:2
17087 ? 00:00:02 node /home/pi/a
17104 pts/0 00:00:00 ps
20801 ? 00:00:16 lxterminal
20806 ? 00:00:00 gnome-pty-helpe
20807 pts/0 00:00:00 bash
21665 ? 00:00:07 dhcpcd
21682 ? 00:00:00 wpa_supplicant
26935 ? 00:00:53 xrdp
root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff# ^C
root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff#

okay you can easily change the port # for the DoNetStuff if you want

sudo nano /etc/systemd/system/DoNetStuff.service

and change the line:

Environment=PORT=3000

To whatever you want.. ctrl x to exit and y to save

You can see what ports are listening by typing this..

sudo lsof -i -P -n | grep LISTEN

1 Like

I think that I have a more basic problem:
root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff# sudo systemctl list-units -t service
UNIT LOAD ACTIVE SUB DESCRIPTION
alsa-restore.service loaded active exited Save/Restore Sound Card State
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
bluealsa.service loaded active running BluezALSA proxy
bluetooth.service loaded active running Bluetooth service
colord.service loaded active running Manage, Install and Generate Color Profiles
console-setup.service loaded active exited Set console font and keymap
cron.service loaded active running Regular background program processing daemon
cups-browsed.service loaded active running Make remote CUPS printers available locally
cups.service loaded active running CUPS Scheduler
dbus.service loaded active running D-Bus System Message Bus
dhcpcd.service loaded active running dhcpcd on all interfaces
โ— DoNetStuff.service loaded failed failed DoNetStuff for Hubitat Service
dphys-swapfile.service loaded active exited LSB: Autogenerate and use a swap file
fake-hwclock.service loaded active exited Restore / save the current clock
getty@tty1.service loaded active running Getty on tty1
gldriver-test.service loaded active exited Check for v3d driver
hciuart.service loaded active running Configure Bluetooth Modems connected by UART
keyboard-setup.service loaded active exited Set the console keyboard layout
kmod-static-nodes.service loaded active exited Create list of required static device nodes for the current kernel
lightdm.service loaded active running Light Display Manager
networking.service loaded active exited Raise network interfaces
nmbd.service loaded active running Samba NMB Daemon
packagekit.service loaded active running PackageKit Daemon
pm2-pi.service loaded active running PM2 process manager
pm2-root.service loaded active running PM2 process manager
polkit.service loaded active running Authorization Manager
raspi-config.service loaded active exited LSB: Switch to ondemand cpu governor (unless shift key is pressed)
rc-local.service loaded active exited /etc/rc.local Compatibility
rsyslog.service loaded active running System Logging Service
smbd.service loaded active running Samba SMB Daemon
ssh.service loaded active running OpenBSD Secure Shell server
systemd-fsck-root.service loaded active exited File System Check on Root Device
systemd-fsck@dev-disk-by\x2dpartuuid-4823afcc\x2d01.service loaded active exited File System Check on /dev/disk/by-partuuid/4823afcc-01
systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-modules-load.service loaded active exited Load Kernel Modules
systemd-random-seed.service loaded active exited Load/Save Random Seed
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-timesyncd.service loaded active running Network Time Synchronization
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
systemd-udevd.service loaded active running udev Kernel Device Manager
systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
systemd-user-sessions.service loaded active exited Permit User Sessions
triggerhappy.service loaded active running triggerhappy global hotkey daemon
udisks2.service loaded active running Disk Manager
user@1000.service loaded active running User Manager for UID 1000
wpa_supplicant.service loaded active running WPA supplicant
xrdp-sesman.service loaded active running xrdp session manager
xrdp.service loaded active running xrdp daemon

LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.

What does

sudo journalctl -xe

return?

root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff# sudo journalctl -xe

-- The start-up result is done.
Jan 30 21:04:42 RASPI systemd[16362]: DoNetStuff.service: Failed at step USER spawning /usr/bin/npm: No such process
-- Subject: Process /usr/bin/npm could not be executed
-- Defined-By: systemd
-- Support: Debian -- User Support

-- The process /usr/bin/npm could not be executed and failed.

-- The error number returned by this process is 3.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Main process exited, code=exited, status=217/USER
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Unit entered failed state.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Failed with result 'exit-code'.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Service hold-off time over, scheduling restart.
Jan 30 21:04:42 RASPI systemd[1]: Stopped DoNetStuff for Hubitat Service.
-- Subject: Unit DoNetStuff.service has finished shutting down
-- Defined-By: systemd
-- Support: Debian -- User Support

-- Unit DoNetStuff.service has finished shutting down.
Jan 30 21:04:42 RASPI systemd[1]: Started DoNetStuff for Hubitat Service.
-- Subject: Unit DoNetStuff.service has finished start-up
-- Defined-By: systemd
-- Support: Debian -- User Support

-- Unit DoNetStuff.service has finished starting up.

-- The start-up result is done.
Jan 30 21:04:42 RASPI systemd[16364]: DoNetStuff.service: Failed at step USER spawning /usr/bin/npm: No such process
-- Subject: Process /usr/bin/npm could not be executed
-- Defined-By: systemd
-- Support: Debian -- User Support

-- The process /usr/bin/npm could not be executed and failed.

-- The error number returned by this process is 3.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Main process exited, code=exited, status=217/USER
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Unit entered failed state.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Failed with result 'exit-code'.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Service hold-off time over, scheduling restart.
Jan 30 21:04:42 RASPI systemd[1]: Stopped DoNetStuff for Hubitat Service.
-- Subject: Unit DoNetStuff.service has finished shutting down
-- Defined-By: systemd
-- Support: Debian -- User Support

-- Unit DoNetStuff.service has finished shutting down.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Start request repeated too quickly.
Jan 30 21:04:42 RASPI systemd[1]: Failed to start DoNetStuff for Hubitat Service.
-- Subject: Unit DoNetStuff.service has failed
-- Defined-By: systemd
-- Support: Debian -- User Support

-- Unit DoNetStuff.service has failed.

-- The result is failed.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Unit entered failed state.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Failed with result 'exit-code'.
Jan 30 21:08:44 RASPI sm-mta[11672]: 00TIekrS007763: to=my@email.com, ctladdr=pi@GTAHomeAutomation.access.ly (1000/1000), delay=1+07:27:58, xdelay=00:08:53, mailer=esmtp, pri=16770302, relay=mx00.mail.com. [74.208.5.20], dsn=4.0.0, st
Jan 30 21:08:44 RASPI sm-mta[11672]: 00TIOKEE002869: to=my@email.com, ctladdr=pi@GTAHomeAutomation.access.ly (1000/1000), delay=1+07:44:24, xdelay=00:00:00, mailer=esmtp, pri=16770308, relay=mx01.mail.com., dsn=4.0.0, stat=Deferred: C
Jan 30 21:08:44 RASPI sm-mta[11672]: 00TIMhQP002374: to=jacklweinberg@gmail.com, ctladdr=pi@GTAHomeAutomation.access.ly (1000/1000), delay=1+07:46:01, xdelay=00:00:00, mailer=esmtp, pri=16770313, relay=alt4.gmail-smtp-in.l.google.com.
Jan 30 21:08:44 RASPI sm-mta[11672]: 00TIdCSo007271: to=jacklweinberg@gmail.com, ctladdr=pi@GTAHomeAutomation.access.ly (1000/1000), delay=1+07:29:32, xdelay=00:00:00, mailer=esmtp, pri=16770326, relay=alt4.gmail-smtp-in.l.google.com.
Jan 30 21:08:44 RASPI sm-mta[11672]: 00TI9AM7030409: to=jacklweinberg@gmail.com, ctladdr=pi@GTAHomeAutomation.access.ly (1000/1000), delay=1+07:59:34, xdelay=00:00:00, mailer=esmtp, pri=16860313, relay=alt4.gmail-smtp-in.l.google.com.
Jan 30 21:08:44 RASPI sm-mta[11672]: 00TIAblt030840: to=jacklweinberg@gmail.com, ctladdr=pi@GTAHomeAutomation.access.ly (1000/1000), delay=1+07:58:07, xdelay=00:00:00, mailer=esmtp, pri=16860313, relay=alt4.gmail-smtp-in.l.google.com.
Jan 30 21:08:44 RASPI sm-mta[11672]: 00TGvm6J009459: to=<>, ctladdr=<> (1000/1000), delay=1+09:10:56, xdelay=00:00:00, mailer=esmtp, pri=17220336, relay=alt4.gmail-smtp-in.l.google.com.
Jan 30 21:08:44 RASPI sm-mta[11672]: 00TGnMJ6007007: to=<>, ctladdr=root@GTAHomeAutomation.access.ly (0/0), delay=1+09:19:22, xdelay=00:00:00, mailer=esmtp, pri=17310333, relay=alt4.gmail-smtp-in.l.google.com., dsn=4.
Jan 30 21:09:50 RASPI sm-mta[14594]: 00TIWo8S005390: to=jacklweinberg@gmail.com, ctladdr=<> (1000/1000), delay=1+07:37:00, xdelay=00:11:05, mailer=esmtp, pri=8400319, relay=alt4.gmail-smtp-in.l.google.com.
Jan 30 21:09:50 RASPI sm-mta[14594]: 00TIkQIe009451: to=<>, ctladdr=<> (1000/1000), delay=1+07:23:24, xdelay=00:00:00, mailer=esmtp, pri=16680340, relay=alt4.gmail-smtp-in.l.google.com.
Jan 30 21:10:27 RASPI sudo[18025]: root : TTY=pts/0 ; PWD=/home/pi/Hubitat-DoNS/DoNetStuff ; USER=root ; COMMAND=/bin/systemctl list-units -t service
Jan 30 21:10:27 RASPI sudo[18025]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 30 21:10:27 RASPI sudo[18025]: pam_unix(sudo:session): session closed for user root
Jan 30 21:14:59 RASPI sudo[19355]: root : TTY=pts/0 ; PWD=/home/pi/Hubitat-DoNS/DoNetStuff ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 30 21:14:59 RASPI sudo[19355]: pam_unix(sudo:session): session opened for user root by (uid=0)
lines 1214-1285/1285 (END)

You are missing "npm".. you might try..

sudo apt-get -f install npm

This is not good...
root@RASPI:/home# sudo apt-get -f install npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
npm : Depends: nodejs but it is not going to be installed
Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed
Depends: node-ansi-color-table but it is not going to be installed
Depends: node-archy but it is not going to be installed
Depends: node-block-stream but it is not going to be installed
Depends: node-fstream (>= 0.1.22) but it is not going to be installed
Depends: node-fstream-ignore but it is not going to be installed
Depends: node-github-url-from-git but it is not going to be installed
Depends: node-glob (>= 3.1.21) but it is not going to be installed
Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
Depends: node-inherits but it is not going to be installed
Depends: node-ini (>= 1.1.0) but it is not going to be installed
Depends: node-lockfile but it is not going to be installed
Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed
Depends: node-minimatch (>= 0.2.11) but it is not going to be installed
Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed
Depends: node-gyp (>= 0.10.9) but it is not going to be installed
Depends: node-nopt (>= 3.0.1) but it is not going to be installed
Depends: node-npmlog but it is not going to be installed
Depends: node-once but it is not going to be installed
Depends: node-osenv but it is not going to be installed
Depends: node-read but it is not going to be installed
Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed
Depends: node-request (>= 2.25.0) but it is not going to be installed
Depends: node-retry but it is not going to be installed
Depends: node-rimraf (>= 2.2.2) but it is not going to be installed
Depends: node-semver (>= 2.1.0) but it is not going to be installed
Depends: node-sha but it is not going to be installed
Depends: node-slide but it is not going to be installed
Depends: node-tar (>= 0.1.18) but it is not going to be installed
Depends: node-underscore but it is not going to be installed
Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@RASPI:/home#

The issue though is the RPI version of Node.js might be really out of date.

you might have to uninstall nodejs then do something like this

Be careful though hopefully your other stuff doesn't use Node.js

1 Like

Unfortunately, same error:
I re-installed latest version of nodejs, and the following shows the version of npm that is currently running:
root@RASPI:/home# npm update
root@RASPI:/home# npm version
{ npm: '6.13.4',
ares: '1.15.0',
brotli: '1.0.7',
cldr: '35.1',
http_parser: '2.8.0',
icu: '64.2',
modules: '64',
napi: '5',
nghttp2: '1.39.2',
node: '10.18.1',
openssl: '1.1.1d',
tz: '2019c',
unicode: '12.1',
uv: '1.28.0',
v8: '6.8.275.32-node.55',
zlib: '1.2.11' }
root@RASPI:/home# cd /home/pi/Hubitat-DoNS/DoNetStuff/
root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff# node app.js
Created route: /email for controllers/email/index.js
events.js:174
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE: address already in use :::3000
at Server.setupListenHandle [as _listen2] (net.js:1280:14)
at listenInCluster (net.js:1328:12)
at Server.listen (net.js:1415:7)
at Function.listen (/home/pi/Hubitat-DoNS/DoNetStuff/node_modules/express/lib/application.js:618:24)
at Object. (/home/pi/Hubitat-DoNS/DoNetStuff/app.js:17:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1307:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
root@RASPI:/home/pi/Hubitat-DoNS/DoNetStuff#

There are 2 errors - the one from systemctl that was complaining about npm missing. The other is that something is already using port 3000...

what's the status of:

sudo systemctl status DoNetStuff

Also what are the results of this:

sudo lsof -i -P -n | grep LISTEN
  1. This is what I get when I try to install the package:
    /Hubitat-DoNS/DoNetStuff/
    pi@RASPI:~/Hubitat-DoNS/DoNetStuff $ npm install
    npm WARN donetstuff@1.0.0 No repository field.

audited 153 packages in 3.122s
found 0 vulnerabilities

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โ”‚
โ”‚ New minor version of npm available! 6.4.1 โ†’ 6.13.7 โ”‚
โ”‚ Changelog: Release v6.13.7 ยท npm/cli ยท GitHub โ”‚
โ”‚ Run npm install -g npm to update! โ”‚
โ”‚ โ”‚

pi@RASPI:~/Hubitat-DoNS/DoNetStuff $ sudo systemctl status DoNetStuff
โ— DoNetStuff.service - DoNetStuff for Hubitat Service
Loaded: loaded (/etc/systemd/system/DoNetStuff.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-01-30 21:04:42 EST; 34min ago
Process: 16364 ExecStart=/usr/bin/npm start (code=exited, status=217/USER)
Main PID: 16364 (code=exited, status=217/USER)

Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Service hold-off time over, scheduling restart.
Jan 30 21:04:42 RASPI systemd[1]: Stopped DoNetStuff for Hubitat Service.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Start request repeated too quickly.
Jan 30 21:04:42 RASPI systemd[1]: Failed to start DoNetStuff for Hubitat Service.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Unit entered failed state.
Jan 30 21:04:42 RASPI systemd[1]: DoNetStuff.service: Failed with result 'exit-code'.
pi@RASPI:~/Hubitat-DoNS/DoNetStuff $ sudo lsof -i -P -n | grep LISTEN
xrdp-sesm 459 root 7u IPv6 12808 0t0 TCP [::1]:3350 (LISTEN)
sshd 506 root 3u IPv4 11532 0t0 TCP *:22 (LISTEN)
sshd 506 root 4u IPv6 11534 0t0 TCP *:22 (LISTEN)
xrdp 508 xrdp 11u IPv6 13918 0t0 TCP *:3389 (LISTEN)
smbd 803 root 33u IPv6 16448 0t0 TCP *:445 (LISTEN)
smbd 803 root 34u IPv6 16449 0t0 TCP *:139 (LISTEN)
smbd 803 root 35u IPv4 16450 0t0 TCP *:445 (LISTEN)
smbd 803 root 36u IPv4 16451 0t0 TCP *:139 (LISTEN)
node\x20/ 905 pi 13u IPv6 16543 0t0 TCP *:3000 (LISTEN)
cupsd 15654 root 9u IPv4 842722 0t0 TCP *:631 (LISTEN)
cupsd 15654 root 10u IPv6 842723 0t0 TCP *:631 (LISTEN)
sendmail- 16341 root 4u IPv4 133876 0t0 TCP 127.0.0.1:25 (LISTEN)
sendmail- 16341 root 5u IPv4 133877 0t0 TCP 127.0.0.1:587 (LISTEN)

I think it's okay the npm looks okay even if it's not updated.. the error in systemctl may also be a path error to npm.

What are the results of this?

sudo lsof -i -P -n | grep LISTEN

@jtmpush18

If your Raspbian installation doesn't have "lsof", could you provide the output of

sudo netstat -tan | grep LISTEN

That would provide @erktrek with information equivalent to the lsof command.

1 Like

see above...

2 Likes

Yup my bad sorry just doing this on the fly!!!!