prey / prey-node-client

Node.js client for the Prey anti-theft software.
http://preyproject.com
GNU General Public License v3.0
329 stars 76 forks source link

Linux Antergos (Arch): npm install -g prey doesn't work #286

Closed ferminako closed 2 years ago

ferminako commented 7 years ago

Hi guys, I runned npm install -g prey and I've go thist:

npm install -g prey /usr/bin/prey -> /usr/lib/node_modules/prey/bin/prey

sqlite3@3.1.8 install /usr/lib/node_modules/prey/node_modules/sqlite3 node-pre-gyp install --fallback-to-build

sh: node-pre-gyp: no se encontró la orden /usr/lib └── (empty)

npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! sqlite3@3.1.8 install: node-pre-gyp install --fallback-to-build npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the sqlite3@3.1.8 install script 'node-pre-gyp install --fallback-to-build'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the sqlite3 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-pre-gyp install --fallback-to-build npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs sqlite3 npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls sqlite3 npm ERR! 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-04-04T15_33_36_889Z-debug.log

Any idea? Thx

javo commented 7 years ago

Hi @ferminako, try running npm install -g node-gyp node-pre-gyp and then install prey again. Let me know if it worked out or not :)

ferminako commented 7 years ago

Hi @javo, I installed node-gyp and node-pre-gyp but I still have problems. [root@sbk ferminako]# npm install -g node-gyp node-pre-gyp /usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js /usr/bin/node-pre-gyp -> /usr/lib/node_modules/node-pre-gyp/bin/node-pre-gyp /usr/lib ├─┬ node-gyp@3.6.0 │ ├─┬ fstream@1.0.11 │ │ ├── graceful-fs@4.1.11 deduped │ │ ├── inherits@2.0.3 │ │ ├── mkdirp@0.5.1 deduped │ │ └── rimraf@2.6.1 deduped │ ├─┬ glob@7.1.1 │ │ ├── fs.realpath@1.0.0 │ │ ├─┬ inflight@1.0.6 │ │ │ ├── once@1.4.0 deduped │ │ │ └── wrappy@1.0.2 │ │ ├── inherits@2.0.3 deduped │ │ ├── minimatch@3.0.3 deduped │ │ ├─┬ once@1.4.0 │ │ │ └── wrappy@1.0.2 deduped │ │ └── path-is-absolute@1.0.1 │ ├── graceful-fs@4.1.11 │ ├─┬ minimatch@3.0.3 │ │ └─┬ brace-expansion@1.1.6 │ │ ├── balanced-match@0.4.2 │ │ └── concat-map@0.0.1 │ ├─┬ mkdirp@0.5.1 │ │ └── minimist@0.0.8 │ ├─┬ nopt@3.0.6 │ │ └── abbrev@1.1.0 │ ├─┬ npmlog@4.0.2 │ │ ├─┬ are-we-there-yet@1.1.2 │ │ │ ├── delegates@1.0.0 │ │ │ └─┬ readable-stream@2.2.6 │ │ │ ├── buffer-shims@1.0.0 │ │ │ ├── core-util-is@1.0.2 │ │ │ ├── inherits@2.0.3 deduped │ │ │ ├── isarray@1.0.0 │ │ │ ├── process-nextick-args@1.0.7 │ │ │ ├── string_decoder@0.10.31 │ │ │ └── util-deprecate@1.0.2 │ │ ├── console-control-strings@1.1.0 │ │ ├─┬ gauge@2.7.3 │ │ │ ├── aproba@1.1.1 │ │ │ ├── console-control-strings@1.1.0 deduped │ │ │ ├── has-unicode@2.0.1 │ │ │ ├── object-assign@4.1.1 │ │ │ ├── signal-exit@3.0.2 │ │ │ ├─┬ string-width@1.0.2 │ │ │ │ ├── code-point-at@1.1.0 │ │ │ │ ├─┬ is-fullwidth-code-point@1.0.0 │ │ │ │ │ └── number-is-nan@1.0.1 │ │ │ │ └── strip-ansi@3.0.1 deduped │ │ │ ├─┬ strip-ansi@3.0.1 │ │ │ │ └── ansi-regex@2.1.1 │ │ │ └─┬ wide-align@1.1.0 │ │ │ └── string-width@1.0.2 deduped │ │ └── set-blocking@2.0.0 │ ├─┬ osenv@0.1.4 │ │ ├── os-homedir@1.0.2 │ │ └── os-tmpdir@1.0.2 │ ├─┬ request@2.81.0 │ │ ├── aws-sign2@0.6.0 │ │ ├── aws4@1.6.0 │ │ ├── caseless@0.12.0 │ │ ├─┬ combined-stream@1.0.5 │ │ │ └── delayed-stream@1.0.0 │ │ ├── extend@3.0.0 │ │ ├── forever-agent@0.6.1 │ │ ├─┬ form-data@2.1.2 │ │ │ ├── asynckit@0.4.0 │ │ │ ├── combined-stream@1.0.5 deduped │ │ │ └── mime-types@2.1.15 deduped │ │ ├─┬ har-validator@4.2.1 │ │ │ ├─┬ ajv@4.11.5 │ │ │ │ ├── co@4.6.0 │ │ │ │ └─┬ json-stable-stringify@1.0.1 │ │ │ │ └── jsonify@0.0.0 │ │ │ └── har-schema@1.0.5 │ │ ├─┬ hawk@3.1.3 │ │ │ ├─┬ boom@2.10.1 │ │ │ │ └── hoek@2.16.3 deduped │ │ │ ├─┬ cryptiles@2.0.5 │ │ │ │ └── boom@2.10.1 deduped │ │ │ ├── hoek@2.16.3 │ │ │ └─┬ sntp@1.0.9 │ │ │ └── hoek@2.16.3 deduped │ │ ├─┬ http-signature@1.1.1 │ │ │ ├── assert-plus@0.2.0 │ │ │ ├─┬ jsprim@1.4.0 │ │ │ │ ├── assert-plus@1.0.0 │ │ │ │ ├── extsprintf@1.0.2 │ │ │ │ ├── json-schema@0.2.3 │ │ │ │ └─┬ verror@1.3.6 │ │ │ │ └── extsprintf@1.0.2 deduped │ │ │ └─┬ sshpk@1.11.0 │ │ │ ├── asn1@0.2.3 │ │ │ ├── assert-plus@1.0.0 │ │ │ ├─┬ bcrypt-pbkdf@1.0.1 │ │ │ │ └── tweetnacl@0.14.5 deduped │ │ │ ├─┬ dashdash@1.14.1 │ │ │ │ └── assert-plus@1.0.0 │ │ │ ├─┬ ecc-jsbn@0.1.1 │ │ │ │ └── jsbn@0.1.1 deduped │ │ │ ├─┬ getpass@0.1.6 │ │ │ │ └── assert-plus@1.0.0 │ │ │ ├─┬ jodid25519@1.0.2 │ │ │ │ └── jsbn@0.1.1 deduped │ │ │ ├── jsbn@0.1.1 │ │ │ └── tweetnacl@0.14.5 │ │ ├── is-typedarray@1.0.0 │ │ ├── isstream@0.1.2 │ │ ├── json-stringify-safe@5.0.1 │ │ ├─┬ mime-types@2.1.15 │ │ │ └── mime-db@1.27.0 │ │ ├── oauth-sign@0.8.2 │ │ ├── performance-now@0.2.0 │ │ ├── qs@6.4.0 │ │ ├── safe-buffer@5.0.1 │ │ ├── stringstream@0.0.5 │ │ ├─┬ tough-cookie@2.3.2 │ │ │ └── punycode@1.4.1 │ │ ├─┬ tunnel-agent@0.6.0 │ │ │ └── safe-buffer@5.0.1 deduped │ │ └── uuid@3.0.1 │ ├─┬ rimraf@2.6.1 │ │ └── glob@7.1.1 deduped │ ├── semver@5.3.0 │ ├─┬ tar@2.2.1 │ │ ├─┬ block-stream@0.0.9 │ │ │ └── inherits@2.0.3 deduped │ │ ├── fstream@1.0.11 deduped │ │ └── inherits@2.0.3 deduped │ └─┬ which@1.2.14 │ └── isexe@2.0.0 └─┬ node-pre-gyp@0.6.34 ├─┬ mkdirp@0.5.1 │ └── minimist@0.0.8 ├─┬ nopt@4.0.1 │ ├── abbrev@1.1.0 │ └─┬ osenv@0.1.4 │ ├── os-homedir@1.0.2 │ └── os-tmpdir@1.0.2 ├─┬ npmlog@4.0.2 │ ├─┬ are-we-there-yet@1.1.2 │ │ ├── delegates@1.0.0 │ │ └── readable-stream@2.2.6 deduped │ ├── console-control-strings@1.1.0 │ ├─┬ gauge@2.7.3 │ │ ├── aproba@1.1.1 │ │ ├── console-control-strings@1.1.0 deduped │ │ ├── has-unicode@2.0.1 │ │ ├── object-assign@4.1.1 │ │ ├── signal-exit@3.0.2 │ │ ├─┬ string-width@1.0.2 │ │ │ ├── code-point-at@1.1.0 │ │ │ ├─┬ is-fullwidth-code-point@1.0.0 │ │ │ │ └── number-is-nan@1.0.1 │ │ │ └── strip-ansi@3.0.1 deduped │ │ ├─┬ strip-ansi@3.0.1 │ │ │ └── ansi-regex@2.1.1 │ │ └─┬ wide-align@1.1.0 │ │ └── string-width@1.0.2 deduped │ └── set-blocking@2.0.0 ├─┬ rc@1.2.1 │ ├── deep-extend@0.4.1 │ ├── ini@1.3.4 │ ├── minimist@1.2.0 │ └── strip-json-comments@2.0.1 ├─┬ request@2.81.0 │ ├── aws-sign2@0.6.0 │ ├── aws4@1.6.0 │ ├── caseless@0.12.0 │ ├─┬ combined-stream@1.0.5 │ │ └── delayed-stream@1.0.0 │ ├── extend@3.0.0 │ ├── forever-agent@0.6.1 │ ├─┬ form-data@2.1.2 │ │ ├── asynckit@0.4.0 │ │ ├── combined-stream@1.0.5 deduped │ │ └── mime-types@2.1.15 deduped │ ├─┬ har-validator@4.2.1 │ │ ├─┬ ajv@4.11.5 │ │ │ ├── co@4.6.0 │ │ │ └─┬ json-stable-stringify@1.0.1 │ │ │ └── jsonify@0.0.0 │ │ └── har-schema@1.0.5 │ ├─┬ hawk@3.1.3 │ │ ├─┬ boom@2.10.1 │ │ │ └── hoek@2.16.3 deduped │ │ ├─┬ cryptiles@2.0.5 │ │ │ └── boom@2.10.1 deduped │ │ ├── hoek@2.16.3 │ │ └─┬ sntp@1.0.9 │ │ └── hoek@2.16.3 deduped │ ├─┬ http-signature@1.1.1 │ │ ├── assert-plus@0.2.0 │ │ ├─┬ jsprim@1.4.0 │ │ │ ├── assert-plus@1.0.0 │ │ │ ├── extsprintf@1.0.2 │ │ │ ├── json-schema@0.2.3 │ │ │ └─┬ verror@1.3.6 │ │ │ └── extsprintf@1.0.2 deduped │ │ └─┬ sshpk@1.11.0 │ │ ├── asn1@0.2.3 │ │ ├── assert-plus@1.0.0 │ │ ├─┬ bcrypt-pbkdf@1.0.1 │ │ │ └── tweetnacl@0.14.5 deduped │ │ ├─┬ dashdash@1.14.1 │ │ │ └── assert-plus@1.0.0 │ │ ├─┬ ecc-jsbn@0.1.1 │ │ │ └── jsbn@0.1.1 deduped │ │ ├─┬ getpass@0.1.6 │ │ │ └── assert-plus@1.0.0 │ │ ├─┬ jodid25519@1.0.2 │ │ │ └── jsbn@0.1.1 deduped │ │ ├── jsbn@0.1.1 │ │ └── tweetnacl@0.14.5 │ ├── is-typedarray@1.0.0 │ ├── isstream@0.1.2 │ ├── json-stringify-safe@5.0.1 │ ├─┬ mime-types@2.1.15 │ │ └── mime-db@1.27.0 │ ├── oauth-sign@0.8.2 │ ├── performance-now@0.2.0 │ ├── qs@6.4.0 │ ├── safe-buffer@5.0.1 │ ├── stringstream@0.0.5 │ ├─┬ tough-cookie@2.3.2 │ │ └── punycode@1.4.1 │ ├─┬ tunnel-agent@0.6.0 │ │ └── safe-buffer@5.0.1 deduped │ └── uuid@3.0.1 ├─┬ rimraf@2.6.1 │ └─┬ glob@7.1.1 │ ├── fs.realpath@1.0.0 │ ├─┬ inflight@1.0.6 │ │ ├── once@1.4.0 deduped │ │ └── wrappy@1.0.2 deduped │ ├── inherits@2.0.3 deduped │ ├─┬ minimatch@3.0.3 │ │ └─┬ brace-expansion@1.1.6 │ │ ├── balanced-match@0.4.2 │ │ └── concat-map@0.0.1 │ ├── once@1.4.0 deduped │ └── path-is-absolute@1.0.1 ├── semver@5.3.0 ├─┬ tar@2.2.1 │ ├─┬ block-stream@0.0.9 │ │ └── inherits@2.0.3 deduped │ ├─┬ fstream@1.0.11 │ │ ├── graceful-fs@4.1.11 │ │ ├── inherits@2.0.3 deduped │ │ ├── mkdirp@0.5.1 deduped │ │ └── rimraf@2.6.1 deduped │ └── inherits@2.0.3 └─┬ tar-pack@3.4.0 ├─┬ debug@2.6.3 │ └── ms@0.7.2 ├── fstream@1.0.11 deduped ├─┬ fstream-ignore@1.0.5 │ ├── fstream@1.0.11 deduped │ ├── inherits@2.0.3 deduped │ └── minimatch@3.0.3 deduped ├─┬ once@1.4.0 │ └── wrappy@1.0.2 ├─┬ readable-stream@2.2.6 │ ├── buffer-shims@1.0.0 │ ├── core-util-is@1.0.2 │ ├── inherits@2.0.3 deduped │ ├── isarray@1.0.0 │ ├── process-nextick-args@1.0.7 │ ├── string_decoder@0.10.31 │ └── util-deprecate@1.0.2 ├── rimraf@2.6.1 deduped ├── tar@2.2.1 deduped └── uid-number@0.0.6

[root@sbk ferminako]# npm install -g prey /usr/bin/prey -> /usr/lib/node_modules/prey/bin/prey

sqlite3@3.1.8 install /usr/lib/node_modules/prey/node_modules/sqlite3 node-pre-gyp install --fallback-to-build

[sqlite3] Success: "/usr/lib/node_modules/prey/node_modules/sqlite3/lib/binding/node-v51-linux-x64/node_sqlite3.node" is installed via remote

prey@1.6.6 postinstall /usr/lib/node_modules/prey ./bin/prey config hooks post_install

module.js:472 throw err; ^

Error: Cannot find module 'internal/fs' at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at evalmachine.:18:20 at Object. (/usr/lib/node_modules/prey/node_modules/graceful-fs/fs.js:11:1) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! prey@1.6.6 postinstall: ./bin/prey config hooks post_install npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the prey@1.6.6 postinstall script './bin/prey config hooks post_install'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the prey package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ./bin/prey config hooks post_install npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs prey npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls prey npm ERR! 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-04-04T18_57_32_227Z-debug.log

Thank you so much ;)

javo commented 7 years ago

Now you have a new error: Error: Cannot find module 'internal/fs', I read that it can be fixed if you delete the node_modules folder and then run npm cache clean and npm install https://github.com/nodejs/node/issues/9658#issuecomment-276676114

ferminako commented 7 years ago

Hi @javo, If I remove /usr/lib/node_modules I can't run npm :S I tried also removing /home/ferminako/node_modules and then run npm cache clean and npm install, but I get: [root@sbk ferminako]# npm cache clean [root@sbk ferminako]# npm install npm WARN enoent ENOENT: no such file or directory, open '/home/ferminako/package.json' npm WARN ferminako No description npm WARN ferminako No repository field. npm WARN ferminako No README data npm WARN ferminako No license field.

JotaRandom commented 7 years ago

I find the same error in Arch running 'prey_project config gui'; the solution was edit /usr/bin/prey_project and change the "$node" to the internal node binary shipped in prey (/opt/prey-node-client/bin/node). since Antergos use the AUR try that solution.

kgleason commented 6 years ago

Also running Antergos, and @jristz's comment did the trick for me. For now (while I find a better solution), I edited the beginning of the file so it looks like this:

$ cat /usr/bin/prey_project
#!/bin/bash

PATH="$PATH:/usr/local/bin"
#dir="$(dirname $0)"
dir="/opt/prey-node-client/bin"