The next step, starting Pimatic, gave similar errors on both Raspberry Pi and Mac:
dietpi@DietPi:~/pimatic-app$ sudo node_modules/pimatic/pimatic.js
coffee-cache: compiling coffee-script file "lib/daemon.coffee"...Done
coffee-cache: compiling coffee-script file "startup.coffee"...Done
coffee-cache: compiling coffee-script file "lib/logger.coffee"...Done
13:31:20.415 2018-08-20 Monday
coffee-cache: compiling coffee-script file "lib/api.coffee"...Done
coffee-cache: compiling coffee-script file "lib/users.coffee"...Done
coffee-cache: compiling coffee-script file "lib/devices.coffee"...Done
coffee-cache: compiling coffee-script file "lib/matcher.coffee"...Done
coffee-cache: compiling coffee-script file "lib/milliseconds.coffee"...Done
coffee-cache: compiling coffee-script file "lib/variables.coffee"...Done
coffee-cache: compiling coffee-script file "lib/variables-ast-builder.coffee"...Done
coffee-cache: compiling coffee-script file "lib/actions.coffee"...Done
coffee-cache: compiling coffee-script file "lib/predicates.coffee"...Done
coffee-cache: compiling coffee-script file "lib/rules.coffee"...Done
coffee-cache: compiling coffee-script file "lib/rules-ast-builder.coffee"...Done
coffee-cache: compiling coffee-script file "lib/plugins.coffee"...Done
coffee-cache: compiling coffee-script file "lib/database.coffee"...Done
coffee-cache: compiling coffee-script file "lib/groups.coffee"...Done
coffee-cache: compiling coffee-script file "lib/pages.coffee"...Done
coffee-cache: compiling coffee-script file "lib/framework.coffee"...Done
13:33:01.851 [pimatic] Starting pimatic version 0.9.43
13:33:01.881 [pimatic] Node.js version 8.11.4
13:33:01.888 [pimatic] OpenSSL version 1.0.2p
coffee-cache: compiling coffee-script file "config-schema.coffee"...Done
13:33:04.388 [pimatic] Installing database package sqlite3, this can take some minutes
13:33:55.481 [pimatic, ppm] > sqlite3@3.1.8 install /home/dietpi/pimatic-app/node_modules/sqlite3
13:33:55.495 [pimatic, ppm] > node-pre-gyp install --fallback-to-build
13:34:01.791 [pimatic, ppm] node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v57-linux-arm.tar.gz
13:34:01.810 [pimatic, ppm] node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.8 and node@8.11.4 (node-v57 ABI) (falling back to source compile with node-gyp)
13:34:06.567 [pimatic, ppm] gyp ERR! configure error
13:34:06.587 [pimatic, ppm] gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
13:34:06.593 [pimatic, ppm] gyp ERR! stack at PythonFinder.failNoPython (/home/dietpi/pimatic-app/node_modules/npm/node_modules/node-gyp/lib/configure.js:482:19)
13:34:06.610 [pimatic, ppm] gyp ERR! stack at PythonFinder.<anonymous> (/home/dietpi/pimatic-app/node_modules/npm/node_modules/node-gyp/lib/configure.js:396:16)
13:34:06.615 [pimatic, ppm] gyp ERR! stack at F (/home/dietpi/pimatic-app/node_modules/npm/node_modules/which/which.js:69:16)
13:34:06.629 [pimatic, ppm] gyp ERR! stack at E (/home/dietpi/pimatic-app/node_modules/npm/node_modules/which/which.js:81:29)
13:34:06.640 [pimatic, ppm] gyp ERR! stack at /home/dietpi/pimatic-app/node_modules/npm/node_modules/which/which.js:90:16
13:34:06.651 [pimatic, ppm] gyp ERR! stack at /home/dietpi/pimatic-app/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
13:34:06.669 [pimatic, ppm] gyp ERR! stack at /home/dietpi/pimatic-app/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
13:34:06.675 [pimatic, ppm] gyp ERR! stack at FSReqWrap.oncomplete (fs.js:135:15)
13:34:06.691 [pimatic, ppm] gyp ERR! System Linux 4.14.52+
13:34:06.698 [pimatic, ppm] gyp ERR! command "/usr/local/bin/node" "/home/dietpi/pimatic-app/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/dietpi/pimatic-app/node_modules/sqlite3/lib/binding/node-v57-linux-arm/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/dietpi/pimatic-app/node_modules/sqlite3/lib/binding/node-v57-linux-arm"
13:34:06.726 [pimatic, ppm] gyp ERR! cwd /home/dietpi/pimatic-app/node_modules/sqlite3
13:34:06.738 [pimatic, ppm] gyp ERR! node -v v8.11.4
13:34:06.749 [pimatic, ppm] gyp ERR! node-gyp -v v3.6.0
13:34:06.769 [pimatic, ppm] gyp ERR! not ok
13:34:06.777 [pimatic, ppm] node-pre-gyp ERR! build error
13:34:06.783 [pimatic, ppm] node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /home/dietpi/pimatic-app/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/dietpi/pimatic-app/node_modules/sqlite3/lib/binding/node-v57-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/dietpi/pimatic-app/node_modules/sqlite3/lib/binding/node-v57-linux-arm' (1)
13:34:06.797 [pimatic, ppm] node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/dietpi/pimatic-app/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
13:34:06.811 [pimatic, ppm] node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
13:34:06.832 [pimatic, ppm] node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
13:34:06.839 [pimatic, ppm] node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
13:34:06.860 [pimatic, ppm] node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
13:34:06.869 [pimatic, ppm] node-pre-gyp ERR! System Linux 4.14.52+
13:34:06.878 [pimatic, ppm] node-pre-gyp ERR! command "/usr/local/bin/node" "/home/dietpi/pimatic-app/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
13:34:06.884 [pimatic, ppm] node-pre-gyp ERR! cwd /home/dietpi/pimatic-app/node_modules/sqlite3
13:34:06.891 [pimatic, ppm] node-pre-gyp ERR! node -v v8.11.4
13:34:06.898 [pimatic, ppm] node-pre-gyp ERR! node-pre-gyp -v v0.6.31
13:34:06.905 [pimatic, ppm] node-pre-gyp ERR! not ok
13:34:06.914 [pimatic, ppm] Failed to execute '/usr/local/bin/node /home/dietpi/pimatic-app/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/dietpi/pimatic-app/node_modules/sqlite3/lib/binding/node-v57-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/dietpi/pimatic-app/node_modules/sqlite3/lib/binding/node-v57-linux-arm' (1)
13:34:07.016 [pimatic, ppm] ERR! Linux 4.14.52+
13:34:07.037 [pimatic, ppm] ERR! argv "/usr/local/bin/node" "/home/dietpi/pimatic-app/node_modules/pimatic/ppm.js" "install" "sqlite3@3.1.8" "--unsafe-perm"
13:34:07.047 [pimatic, ppm] ERR! node v8.11.4
13:34:07.062 [pimatic, ppm] ERR! npm v2.15.12
13:34:07.072 [pimatic, ppm] ERR! code ELIFECYCLE
13:34:07.093 [pimatic, ppm] ERR! sqlite3@3.1.8 install: `node-pre-gyp install --fallback-to-build`
13:34:07.099 [pimatic, ppm] ERR! Exit status 1
13:34:07.117 [pimatic, ppm] ERR!
13:34:07.136 [pimatic, ppm] ERR! Failed at the sqlite3@3.1.8 install script 'node-pre-gyp install --fallback-to-build'.
13:34:07.142 [pimatic, ppm] ERR! This is most likely a problem with the sqlite3 package,
13:34:07.153 [pimatic, ppm] ERR! not with npm itself.
13:34:07.170 [pimatic, ppm] ERR! Tell the author that this fails on your system:
13:34:07.180 [pimatic, ppm] ERR! node-pre-gyp install --fallback-to-build
13:34:07.201 [pimatic, ppm] ERR! You can get information on how to open an issue for this project with:
13:34:07.207 [pimatic, ppm] ERR! npm bugs sqlite3
13:34:07.220 [pimatic, ppm] ERR! Or if that isn't available, you can get their info via:
13:34:07.267 [pimatic, ppm] ERR!
13:34:07.275 [pimatic, ppm] ERR! npm owner ls sqlite3
13:34:07.293 [pimatic, ppm] ERR! There is likely additional logging output above.
13:34:13.824 [pimatic, ppm] ERR! Please include the following file with any support request:
13:34:13.834 [pimatic, ppm] ERR! /home/dietpi/pimatic-app/npm-debug.log
13:34:13.980 [pimatic] Startup error: Error: Error running "./node_modules/pimatic/ppm.js install sqlite3@3.1.8 --unsafe-perm"
13:34:13.980 [pimatic]> at ChildProcess.<anonymous> (/home/dietpi/pimatic-app/node_modules/pimatic/lib/plugins.coffee:374:20)
13:34:13.980 [pimatic]> at emitTwo (events.js:126:13)
13:34:13.980 [pimatic]> at ChildProcess.emit (events.js:214:7)
13:34:13.980 [pimatic]> at maybeClose (internal/child_process.js:925:16)
13:34:13.980 [pimatic]> at Socket.stream.socket.on (internal/child_process.js:346:11)
13:34:13.980 [pimatic]> at emitOne (events.js:116:13)
13:34:13.980 [pimatic]> at Socket.emit (events.js:211:7)
13:34:13.980 [pimatic]> at Pipe._handle.close [as _onclose] (net.js:557:12)
13:34:13.998 [pimatic] exiting...
The problem here seems to be that opening this like:
https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v57-linux-arm.tar.gz
Results in an access denied error from the mapbox server (tested in browser).