maddox / dasher

🔘 A simple way to bridge your Amazon Dash buttons to HTTP services
MIT License
710 stars 93 forks source link

Errors during "sudo npm run start" command #85

Open miguelguti80 opened 7 years ago

miguelguti80 commented 7 years ago

Hello, I recive the following error while try to run "sudo npm run start" command:

dasher@1.4.1 start /root/dasher node app.js

module.js:328 throw err; ^

Error: Cannot find module './config/config.json' at Function.Module._resolveFilename (module.js:326:15) at Function.Module._load (module.js:277:25) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object. (/root/dasher/app.js:2:14) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Function.Module.runMain (module.js:442:10) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! dasher@1.4.1 start: node app.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the dasher@1.4.1 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2017-07-10T08_04_56_484Z-debug.log

The debug.log says:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/nodejs', '/usr/local/bin/npm', 'run', 'start' ] 2 info using npm@5.1.0 3 info using node@v4.2.6 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle dasher@1.4.1~prestart: dasher@1.4.1 6 info lifecycle dasher@1.4.1~start: dasher@1.4.1 7 verbose lifecycle dasher@1.4.1~start: unsafe-perm in lifecycle true 8 verbose lifecycle dasher@1.4.1~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/root/dasher/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin 9 verbose lifecycle dasher@1.4.1~start: CWD: /root/dasher 10 silly lifecycle dasher@1.4.1~start: Args: [ '-c', 'node app.js' ] 11 silly lifecycle dasher@1.4.1~start: Returned: code: 1 signal: null 12 info lifecycle dasher@1.4.1~start: Failed to exec start script 13 verbose stack Error: dasher@1.4.1 start: node app.js 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:289:16) 13 verbose stack at emitTwo (events.js:87:13) 13 verbose stack at EventEmitter.emit (events.js:172:7) 13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 13 verbose stack at emitTwo (events.js:87:13) 13 verbose stack at ChildProcess.emit (events.js:172:7) 13 verbose stack at maybeClose (internal/child_process.js:821:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 14 verbose pkgid dasher@1.4.1 15 verbose cwd /root/dasher 16 verbose Linux 4.4.0-43-Microsoft 17 verbose argv "/usr/bin/nodejs" "/usr/local/bin/npm" "run" "start" 18 verbose node v4.2.6 19 verbose npm v5.1.0 20 error code ELIFECYCLE 21 error errno 1 22 error dasher@1.4.1 start: node app.js 22 error Exit status 1 23 error Failed at the dasher@1.4.1 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

Thanks a lot!!

elmedico27 commented 7 years ago

Looks like you're missing your config.json file. Once you've edited the config.example.json file, you'll need to rename it/make a copy and call it config.json. Make sure it stays in the ./dasher/config/ folder.