Hello,
i am getting problems with a new install of pimatic.
Running on a Raspberry Pi 2 with fresh installed Raspbian Jessi, did apt-get update and upgrade. I followed the instructions on the Getting stated page. Started pimatic for the first time with “sudo ./pimatic-app/node_modules/pimatic/pimatic.js start” i got this error:
coffee-cache: compiling coffee-script file "startup.coffee"...Done
coffee-cache: compiling coffee-script file "lib/logger.coffee"...Done
17:08:55.948 2016-05-26 Thursday
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
17:09:27.408 [pimatic] info: Starting pimatic version 0.8.107
coffee-cache: compiling coffee-script file "config-schema.coffee"...Done
17:09:28.868 [pimatic] info: Installing database package sqlite3, this can take some minutes
17:09:31.686 [pimatic, npm] info: http GET https://registry.npmjs.org/sqlite3
17:09:32.173 [pimatic, npm] info: http 200 https://registry.npmjs.org/sqlite3
17:09:32.359 [pimatic, npm] info: http GET https://registry.npmjs.org/sqlite3/-/sqlite3-3.1.4.tgz
17:09:32.560 [pimatic, npm] info: http 200 https://registry.npmjs.org/sqlite3/-/sqlite3-3.1.4.tgz
17:09:49.184 [pimatic, npm] info: http GET https://registry.npmjs.org/nan
17:09:49.455 [pimatic, npm] info: http 200 https://registry.npmjs.org/nan
17:09:49.544 [pimatic, npm] info: http GET https://registry.npmjs.org/nan/-/nan-2.3.3.tgz
17:09:49.712 [pimatic, npm] info: http 200 https://registry.npmjs.org/nan/-/nan-2.3.3.tgz
17:09:51.715 [pimatic, npm] info: > sqlite3@3.1.4 install /home/pi/pimatic-app/node_modules/sqlite3
17:09:51.718 [pimatic, npm] info: > node-pre-gyp install --fallback-to-build
17:09:52.105 [pimatic, npm] info: module.js:340
17:09:52.109 [pimatic, npm] info: throw err;
17:09:52.114 [pimatic, npm] info: ^
17:09:52.124 [pimatic, npm] info: Error: Cannot find module 'nopt'
17:09:52.128 [pimatic, npm] info: at Function.Module._resolveFilename (module.js:338:15)
17:09:52.130 [pimatic, npm] info: at Function.Module._load (module.js:280:25)
17:09:52.133 [pimatic, npm] info: at Module.require (module.js:364:17)
17:09:52.138 [pimatic, npm] info: at require (module.js:380:17)
17:09:52.140 [pimatic, npm] info: at Object.<anonymous> (/home/pi/pimatic-app/node_modules/sqlite3/node_modules/node-pre-gyp/lib/node-pre-gyp.js:14:12)
17:09:52.143 [pimatic, npm] info: at Module._compile (module.js:456:26)
17:09:52.147 [pimatic, npm] info: at Object.Module._extensions..js (module.js:474:10)
17:09:52.149 [pimatic, npm] info: at Module.load (module.js:356:32)
17:09:52.151 [pimatic, npm] info: at Function.Module._load (module.js:312:12)
17:09:52.154 [pimatic, npm] info: at Module.require (module.js:364:17)
17:09:52.223 [pimatic, npm] info: ERR! sqlite3@3.1.4 install: `node-pre-gyp install --fallback-to-build`
17:09:52.227 [pimatic, npm] info: ERR! Exit status 8
17:09:52.229 [pimatic, npm] info: ERR!
17:09:52.232 [pimatic, npm] info: ERR! Failed at the sqlite3@3.1.4 install script.
17:09:52.236 [pimatic, npm] info: ERR! This is most likely a problem with the sqlite3 package,
17:09:52.238 [pimatic, npm] info: ERR! not with npm itself.
17:09:52.241 [pimatic, npm] info: ERR! Tell the author that this fails on your system:
17:09:52.243 [pimatic, npm] info: ERR! node-pre-gyp install --fallback-to-build
17:09:52.246 [pimatic, npm] info: ERR! You can get their info via:
17:09:52.248 [pimatic, npm] info: ERR! npm owner ls sqlite3
17:09:52.251 [pimatic, npm] info: ERR! There is likely additional logging output above.
17:09:52.255 [pimatic, npm] info: ERR! System Linux 4.4.9-v7+
17:09:52.258 [pimatic, npm] info: ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "sqlite3"
17:09:52.261 [pimatic, npm] info: ERR! cwd /home/pi/pimatic-app
17:09:52.263 [pimatic, npm] info: ERR! node -v v0.10.24
17:09:52.267 [pimatic, npm] info: ERR! npm -v 1.3.21
17:09:52.269 [pimatic, npm] info: ERR! code ELIFECYCLE
17:09:52.349 [pimatic, npm] info: ERR!
17:09:52.372 [pimatic, npm] info: ERR! Additional logging details can be found in:
17:09:52.375 [pimatic, npm] info: ERR! /home/pi/pimatic-app/npm-debug.log
17:09:52.377 [pimatic, npm] info: ERR! not ok code 0
17:09:52.421 [pimatic] error: Startup error: Error: Error running "npm install sqlite3"
17:09:52.421 [pimatic] error:> at ChildProcess.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic/lib/plugins.coffee:327:24)
17:09:52.421 [pimatic] error:> at ChildProcess.EventEmitter.emit (events.js:98:17)
17:09:52.421 [pimatic] error:> at maybeClose (child_process.js:735:16)
17:09:52.421 [pimatic] error:> at Socket.<anonymous> (child_process.js:948:11)
17:09:52.421 [pimatic] error:> at Socket.EventEmitter.emit (events.js:95:17)
17:09:52.421 [pimatic] error:> at Pipe.close (net.js:466:12)
17:09:52.424 [pimatic] info: exiting...
I tried to install sqlite3 nanually but also fails. Can please give me a hint?
Edit: Thank you for helping, for my system i solved this error with:
sudo npm install nopt
sudo npm install npmlog
sudo npm install semver
sudo npm install rimraf
sudo npm install sqlite3 --unsafe-perm