{"action":"created","issue":{"url":"https://api.github.com/repos/maddox/dasher/issues/19","repository_url":"https://api.github.com/repos/maddox/dasher","labels_url":"https://api.github.com/repos/maddox/dasher/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/maddox/dasher/issues/19/comments","events_url":"https://api.github.com/repos/maddox/dasher/issues/19/events","html_url":"https://github.com/maddox/dasher/issues/19","id":158513385,"number":19,"title":"Errors During 'npm install' in Two Environments","user":{"login":"BzowK","id":4173211,"avatar_url":"https://avatars.githubusercontent.com/u/4173211?v=3","gravatar_id":"","url":"https://api.github.com/users/BzowK","html_url":"https://github.com/BzowK","followers_url":"https://api.github.com/users/BzowK/followers","following_url":"https://api.github.com/users/BzowK/following{/other_user}","gists_url":"https://api.github.com/users/BzowK/gists{/gist_id}","starred_url":"https://api.github.com/users/BzowK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BzowK/subscriptions","organizations_url":"https://api.github.com/users/BzowK/orgs","repos_url":"https://api.github.com/users/BzowK/repos","events_url":"https://api.github.com/users/BzowK/events{/privacy}","received_events_url":"https://api.github.com/users/BzowK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-06-04T16:56:39Z","updated_at":"2016-11-24T15:18:58Z","closed_at":null,"body":"Hey - Thanks for the script.  Trying to use, but cannot get working.  Have tried setting up in two separate linux environments with same issue.  Below is environment, procedure i followed, and results.  Any suggestions?  Thanks\n\n**Environment**\n- Raspberry Pi 3 /w Raspbian Installed\n- Connected via ethernet to LAN\n\n_I also tried Ubuntu 15.10 inside VM Workstation /w bridged NIC and got similar results_\n\n**Procedure**\n1. Obtained MAC of Dash from router\n2. Ran 'apt-get update' to update source\n3. Installed git, npm, & libpcap-dev without issue\n4. Created SSH key and added to my git account\n5. Ran 'git clone git@github.com:maddox/dasher.git' to clone repo successfully\n6. Ran 'npm install'.  Got following echo...\n\n```\npi@KNCar:~ $ npm install\nnpm ERR! install Couldn't read dependencies\nnpm ERR! package.json ENOENT, open '/home/pi/package.json'\nnpm ERR! package.json This is most likely not a problem with npm itself.\nnpm ERR! package.json npm can't find a package.json file in your current directory.\n\nnpm ERR! System Linux 4.1.19-v7+\nnpm ERR! command \"/usr/bin/nodejs\" \"/usr/bin/npm\" \"install\"\nnpm ERR! cwd /home/pi\nnpm ERR! node -v v0.10.29\nnpm ERR! npm -v 1.4.21\nnpm ERR! path /home/pi/package.json\nnpm ERR! code ENOPACKAGEJSON\nnpm ERR! errno 34\nnpm ERR! \nnpm ERR! Additional logging details can be found in:\nnpm ERR!     /home/pi/npm-debug.log\nnpm ERR! not ok code 0\n\n```\n1. Since it couldn't find package.json, I changed directory to the dasher root (~/dasher) and ran 'npm install' again to get this echo:\n\n```\npi@KNCar:~/dasher $ npm install\nnpm WARN engine socketwatcher@0.3.0: wanted: {\"node\":\">=4\"} (current: {\"node\":\"0.10.29\",\"npm\":\"1.4.21\"})\n\n> socketwatcher@0.3.0 install /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher\n> node-gyp rebuild\n\nmake: Entering directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'\n  CXX(target) Release/obj.target/socketwatcher/socket_watcher.o\nIn file included from ../socket_watcher.hpp:8:0,\n                 from ../socket_watcher.cpp:5:\n../../nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’\n   static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;\n                                               ^\nsocketwatcher.target.mk:82: recipe for target 'Release/obj.target/socketwatcher/socket_watcher.o' failed\nmake: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1\nmake: Leaving directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'\ngyp ERR! build error \ngyp ERR! stack Error: `make` failed with exit code: 2\ngyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)\ngyp ERR! stack     at ChildProcess.emit (events.js:98:17)\ngyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)\ngyp ERR! System Linux 4.1.19-v7+\ngyp ERR! command \"nodejs\" \"/usr/bin/node-gyp\" \"rebuild\"\ngyp ERR! cwd /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher\ngyp ERR! node -v v0.10.29\ngyp ERR! node-gyp -v v0.12.2\ngyp ERR! not ok \nnpm WARN This failure might be due to the use of legacy binary \"node\"\nnpm WARN For further explanations, please read\n/usr/share/doc/nodejs/README.Debian\n\nnpm ERR! socketwatcher@0.3.0 install: `node-gyp rebuild`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the socketwatcher@0.3.0 install script.\nnpm ERR! This is most likely a problem with the socketwatcher package,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR!     node-gyp rebuild\nnpm ERR! You can get their info via:\nnpm ERR!     npm owner ls socketwatcher\nnpm ERR! There is likely additional logging output above.\n\nnpm ERR! System Linux 4.1.19-v7+\nnpm ERR! command \"/usr/bin/nodejs\" \"/usr/bin/npm\" \"install\"\nnpm ERR! cwd /home/pi/dasher\nnpm ERR! node -v v0.10.29\nnpm ERR! npm -v 1.4.21\nnpm ERR! code ELIFECYCLE\nnpm WARN engine hawk@3.1.3: wanted: {\"node\":\">=0.10.32\"} (current: {\"node\":\"0.10.29\",\"npm\":\"1.4.21\"})\nnpm WARN engine cryptiles@2.0.5: wanted: {\"node\":\">=0.10.40\"} (current: {\"node\":\"0.10.29\",\"npm\":\"1.4.21\"})\nnpm WARN engine hoek@2.16.3: wanted: {\"node\":\">=0.10.40\"} (current: {\"node\":\"0.10.29\",\"npm\":\"1.4.21\"})\nnpm WARN engine boom@2.10.1: wanted: {\"node\":\">=0.10.40\"} (current: {\"node\":\"0.10.29\",\"npm\":\"1.4.21\"})\nnpm ERR! \nnpm ERR! Additional logging details can be found in:\nnpm ERR!     /home/pi/dasher/npm-debug.log\nnpm ERR! not ok code 0\n```\n1. Finally, I decided to try to launch it anyways to see what happened so from the root of ~/dasher ran 'sudo npm run start' and got the below:\n\n```\npi@KNCar:~/dasher $ sudo npm run start\n\n> dasher@1.1.1 start /home/pi/dasher\n> node app.js\n\n\nmodule.js:340\n    throw err;\n          ^\nError: Cannot find module 'node-dash-button'\n    at Function.Module._resolveFilename (module.js:338:15)\n    at Function.Module._load (module.js:280:25)\n    at Module.require (module.js:364:17)\n    at require (module.js:380:17)\n    at Object.<anonymous> (/home/pi/dasher/lib/dasher.js:2:18)\n    at Module._compile (module.js:456:26)\n    at Object.Module._extensions..js (module.js:474:10)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\n    at Module.require (module.js:364:17)\n\nnpm ERR! dasher@1.1.1 start: `node app.js`\nnpm ERR! Exit status 8\nnpm ERR! \nnpm ERR! Failed at the dasher@1.1.1 start script.\nnpm ERR! This is most likely a problem with the dasher package,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR!     node app.js\nnpm ERR! You can get their info via:\nnpm ERR!     npm owner ls dasher\nnpm ERR! There is likely additional logging output above.\nnpm ERR! System Linux 4.1.19-v7+\nnpm ERR! command \"/usr/bin/nodejs\" \"/usr/bin/npm\" \"run\" \"start\"\nnpm ERR! cwd /home/pi/dasher\nnpm ERR! node -v v0.10.29\nnpm ERR! npm -v 1.4.21\nnpm ERR! code ELIFECYCLE\nnpm WARN This failure might be due to the use of legacy binary \"node\"\nnpm WARN For further explanations, please read\n/usr/share/doc/nodejs/README.Debian\n\nnpm ERR! \nnpm ERR! Additional logging details can be found in:\nnpm ERR!     /home/pi/dasher/npm-debug.log\nnpm ERR! not ok code 0\n```\n\nAny suggestions?  Am I leaving out a big step?  Thanks!\n\n**UPDATE**\nAfter posting, I went back to the Ubunutu 15 VM.  I installed nodejs-legacy then tried again and this time 'npm install' again and this time it completed without errors.  I had tried installing it in Raspbian on my RP, but it was already installed and up to date so doesn't help there.  Would still much prefer to run on RP so the above post is still valid as all notes come from its installation.  Thanks!\n\n**UPDATE #2** \nOK, ok, I spoke too soon...\n'npm install' seemed to be successful as I didn't see any error messages.  I edited the example config file (below) and then saved it in the same path as config.json.  While still in the 'dasher' root, I then ran 'sudo npm run start' - it started!  I clicked my dash button and after a few seconds, the terminal flooded with about 20 mesage about EthernetFrame.  The trigger from IFTTT never went so I clicked the button again.  Almost instantly, I got the echo \"undefined press\" followed by many lines of echo in the terminal.  I quit npm, then tried launching it again but got errors.  All of the events described are below followed by my config file...\n\n```\nben@ubuntu:~/dasher$ sudo npm run start\n\n> dasher@1.1.1 start /home/ben/dasher\n> node app.js\n\nundefined added.\nundefined added.\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nnode_pcap: EthernetFrame() - Don't know how to decode ethertype 35033\nundefined pressed.\nthere was an error\n[Error: SELF_SIGNED_CERT_IN_CHAIN]\n\n/home/ben/dasher/lib/dasher.js:38\n    if (response.statusCode === 401) {\n                ^\nTypeError: Cannot read property 'statusCode' of undefined\n    at Request.onResponse [as _callback] (/home/ben/dasher/lib/dasher.js:38:17)\n    at self.callback (/home/ben/dasher/node_modules/request/request.js:200:22)\n    at Request.EventEmitter.emit (events.js:95:17)\n    at Request.onRequestError (/home/ben/dasher/node_modules/request/request.js:831:8)\n    at ClientRequest.EventEmitter.emit (events.js:95:17)\n    at CleartextStream.socketErrorListener (http.js:1547:9)\n    at CleartextStream.EventEmitter.emit (events.js:95:17)\n    at SecurePair.<anonymous> (tls.js:1389:19)\n    at SecurePair.EventEmitter.emit (events.js:92:17)\n    at SecurePair.maybeInitFinished (tls.js:982:10)\n\nnpm ERR! dasher@1.1.1 start: `node app.js`\nnpm ERR! Exit status 8\nnpm ERR! \nnpm ERR! Failed at the dasher@1.1.1 start script.\nnpm ERR! This is most likely a problem with the dasher package,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR!     node app.js\nnpm ERR! You can get their info via:\nnpm ERR!     npm owner ls dasher\nnpm ERR! There is likely additional logging output above.\nnpm ERR! System Linux 4.2.0-16-generic\nnpm ERR! command \"/usr/bin/nodejs\" \"/usr/bin/npm\" \"run\" \"start\"\nnpm ERR! cwd /home/ben/dasher\nnpm ERR! node -v v0.10.25\nnpm ERR! npm -v 1.4.21\nnpm ERR! code ELIFECYCLE\nnpm WARN This failure might be due to the use of legacy binary \"node\"\nnpm WARN For further explanations, please read\n/usr/share/doc/nodejs/README.Debian\n\nnpm ERR! \nnpm ERR! Additional logging details can be found in:\nnpm ERR!     /home/ben/dasher/npm-debug.log\nnpm ERR! not ok code 0\nben@ubuntu:~/dasher$ sudo npm run start\n\n> dasher@1.1.1 start /home/ben/dasher\n> node app.js\n\n\nmodule.js:485\n    throw err;\n          ^\nSyntaxError: /home/ben/dasher/config/config.json: Unexpected token ]\n    at Object.parse (native)\n    at Object.Module._extensions..json (module.js:482:27)\n    at Module.load (module.js:356:32)\n    at Function.Module._load (module.js:312:12)\n    at Module.require (module.js:364:17)\n    at require (module.js:380:17)\n    at Object.<anonymous> (/home/ben/dasher/app.js:2:14)\n    at Module._compile (module.js:456:26)\n    at Object.Module._extensions..js (module.js:474:10)\n    at Module.load (module.js:356:32)\n\nnpm ERR! dasher@1.1.1 start: `node app.js`\nnpm ERR! Exit status 8\nnpm ERR! \nnpm ERR! Failed at the dasher@1.1.1 start script.\nnpm ERR! This is most likely a problem with the dasher package,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR!     node app.js\nnpm ERR! You can get their info via:\nnpm ERR!     npm owner ls dasher\nnpm ERR! There is likely additional logging output above.\nnpm ERR! System Linux 4.2.0-16-generic\nnpm ERR! command \"/usr/bin/nodejs\" \"/usr/bin/npm\" \"run\" \"start\"\nnpm ERR! cwd /home/ben/dasher\nnpm ERR! node -v v0.10.25\nnpm ERR! npm -v 1.4.21\nnpm ERR! code ELIFECYCLE\nnpm WARN This failure might be due to the use of legacy binary \"node\"\nnpm WARN For further explanations, please read\n/usr/share/doc/nodejs/README.Debian\n\nnpm ERR! \nnpm ERR! Additional logging details can be found in:\nnpm ERR!     /home/ben/dasher/npm-debug.log\nnpm ERR! not ok code 0\n\n```\n\n**My (Edited) config.json file**\n\n```\n{\"buttons\":[\n  {\n    \"address\": \"mymacaddress\",\n    \"url\": \"https://maker.ifttt.com/trigger/Notify/with/key/mykey\",\n    \"method\": \"POST\"\n  },\n]}\n```\n\nThoughts?  Thanks!\n"},"comment":{"url":"https://api.github.com/repos/maddox/dasher/issues/comments/262798872","html_url":"https://github.com/maddox/dasher/issues/19#issuecomment-262798872","issue_url":"https://api.github.com/repos/maddox/dasher/issues/19","id":262798872,"user":{"login":"webdigi","id":467830,"avatar_url":"https://avatars.githubusercontent.com/u/467830?v=3","gravatar_id":"","url":"https://api.github.com/users/webdigi","html_url":"https://github.com/webdigi","followers_url":"https://api.github.com/users/webdigi/followers","following_url":"https://api.github.com/users/webdigi/following{/other_user}","gists_url":"https://api.github.com/users/webdigi/gists{/gist_id}","starred_url":"https://api.github.com/users/webdigi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdigi/subscriptions","organizations_url":"https://api.github.com/users/webdigi/orgs","repos_url":"https://api.github.com/users/webdigi/repos","events_url":"https://api.github.com/users/webdigi/events{/privacy}","received_events_url":"https://api.github.com/users/webdigi/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T15:18:58Z","updated_at":"2016-11-24T15:18:58Z","body":"Had the same issue and nothing would work. Finally had to go to node 0.10.26 on the pi.\r\n\r\nUsed NVM instead of direct node install.\r\ncurl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash\r\nnvm install 0.10.26\r\n\r\n"}}
{"actor":{"display_login":"webdigi"}}