vesparny / fair-analytics

📊 An analytics server that doesn't undermine user's privacy
MIT License
748 stars 24 forks source link

SyntaxError: Unexpected token function #9

Closed ilyar closed 7 years ago

ilyar commented 7 years ago
OS: 4.4.0-78-generic x86_64 GNU/Linux 
nvm: 0.29.0 
node: v6.10.3 
npm: 4.6.1

npm install -g fair-analytics
Click to expand the log
/home/user/.nvm/versions/node/v6.10.3/bin/fair-analytics -> /home/user/.nvm/versions/node/v6.10.3/lib/node_modules/fair-analytics/bin/index.js

> sodium-native@1.9.0 install /home/user/.nvm/versions/node/v6.10.3/lib/node_modules/fair-analytics/node_modules/sodium-native
> node-gyp-build "node preinstall.js" "node postinstall.js"

> utp-native@1.5.0 install /home/user/.nvm/versions/node/v6.10.3/lib/node_modules/fair-analytics/node_modules/utp-native
> node-gyp-build

/home/user/.nvm/versions/node/v6.10.3/lib
└─┬ fair-analytics@1.0.3 
  ├─┬ args@2.6.1 
  │ ├── camelcase@4.1.0 
  │ ├─┬ chalk@1.1.3 
  │ │ ├── ansi-styles@2.2.1 
  │ │ ├── escape-string-regexp@1.0.5 
  │ │ ├─┬ has-ansi@2.0.0 
  │ │ │ └── ansi-regex@2.1.1 
  │ │ ├─┬ strip-ansi@3.0.1 
  │ │ │ └── ansi-regex@2.1.1  deduped
  │ │ └── supports-color@2.0.0 
  │ ├── minimist@1.2.0 
  │ ├── pkginfo@0.4.0 
  │ └─┬ string-similarity@1.1.0 
  │   └── lodash@4.17.4  deduped
  ├── brcast@2.0.0 
  ├── denodeify@1.2.1 
  ├─┬ enqueue@1.0.2 
  │ └── sliced@0.0.5 
  ├─┬ flat-file-db@1.0.0 
  │ └── mkdirp@0.3.5 
  ├─┬ hypercore@6.2.3 
  │ ├── array-lru@1.1.1 
  │ ├── atomic-batcher@1.0.2 
  │ ├─┬ bitfield-rle@2.1.0 
  │ │ └── varint@4.0.1 
  │ ├── buffer-equals@1.0.4 
  │ ├─┬ bulk-write-stream@1.1.3 
  │ │ ├── inherits@2.0.3  deduped
  │ │ └─┬ readable-stream@2.2.9 
  │ │   ├── 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  deduped
  │ │   ├─┬ string_decoder@1.0.1 
  │ │   │ └── safe-buffer@5.0.1  deduped
  │ │   └── util-deprecate@1.0.2 
  │ ├── codecs@1.2.0 
  │ ├── flat-tree@1.6.0 
  │ ├─┬ from2@2.3.0 
  │ │ ├── inherits@2.0.3  deduped
  │ │ └── readable-stream@2.2.9  deduped
  │ ├─┬ hypercore-protocol@6.3.1 
  │ │ ├─┬ brfs@1.4.3 
  │ │ │ ├─┬ quote-stream@1.0.2 
  │ │ │ │ ├── buffer-equal@0.0.1 
  │ │ │ │ ├── minimist@1.2.0  deduped
  │ │ │ │ └── through2@2.0.3  deduped
  │ │ │ ├─┬ resolve@1.3.3 
  │ │ │ │ └── path-parse@1.0.5 
  │ │ │ ├─┬ static-module@1.3.2 
  │ │ │ │ ├─┬ concat-stream@1.6.0 
  │ │ │ │ │ ├── inherits@2.0.3  deduped
  │ │ │ │ │ ├── readable-stream@2.2.9  deduped
  │ │ │ │ │ └── typedarray@0.0.6 
  │ │ │ │ ├─┬ duplexer2@0.0.2 
  │ │ │ │ │ └─┬ readable-stream@1.1.14 
  │ │ │ │ │   ├── core-util-is@1.0.2  deduped
  │ │ │ │ │   ├── inherits@2.0.3  deduped
  │ │ │ │ │   ├── isarray@0.0.1 
  │ │ │ │ │   └── string_decoder@0.10.31 
  │ │ │ │ ├─┬ escodegen@1.3.3 
  │ │ │ │ │ ├── esprima@1.1.1 
  │ │ │ │ │ ├── estraverse@1.5.1 
  │ │ │ │ │ ├── esutils@1.0.0 
  │ │ │ │ │ └─┬ source-map@0.1.43 
  │ │ │ │ │   └── amdefine@1.0.1 
  │ │ │ │ ├─┬ falafel@1.2.0 
  │ │ │ │ │ ├── acorn@1.2.2 
  │ │ │ │ │ ├── foreach@2.0.5 
  │ │ │ │ │ ├── isarray@0.0.1 
  │ │ │ │ │ └── object-keys@1.0.11 
  │ │ │ │ ├─┬ has@1.0.1 
  │ │ │ │ │ └── function-bind@1.1.0 
  │ │ │ │ ├── object-inspect@0.4.0 
  │ │ │ │ ├─┬ quote-stream@0.0.0 
  │ │ │ │ │ ├── minimist@0.0.8 
  │ │ │ │ │ └── through2@0.4.2  deduped
  │ │ │ │ ├─┬ readable-stream@1.0.34 
  │ │ │ │ │ ├── core-util-is@1.0.2  deduped
  │ │ │ │ │ ├── inherits@2.0.3  deduped
  │ │ │ │ │ ├── isarray@0.0.1 
  │ │ │ │ │ └── string_decoder@0.10.31 
  │ │ │ │ ├── shallow-copy@0.0.1 
  │ │ │ │ ├─┬ static-eval@0.2.4 
  │ │ │ │ │ └─┬ escodegen@0.0.28 
  │ │ │ │ │   ├── esprima@1.0.4 
  │ │ │ │ │   ├── estraverse@1.3.2 
  │ │ │ │ │   └── source-map@0.1.43  deduped
  │ │ │ │ └─┬ through2@0.4.2 
  │ │ │ │   ├── readable-stream@1.0.34  deduped
  │ │ │ │   └─┬ xtend@2.1.2 
  │ │ │ │     └── object-keys@0.4.0 
  │ │ │ └─┬ through2@2.0.3 
  │ │ │   ├── readable-stream@2.2.9  deduped
  │ │ │   └── xtend@4.0.1  deduped
  │ │ ├── inherits@2.0.3  deduped
  │ │ ├─┬ protocol-buffers@3.2.1 
  │ │ │ ├── brfs@1.4.3  deduped
  │ │ │ ├── generate-function@2.0.0 
  │ │ │ ├─┬ generate-object-property@1.2.0 
  │ │ │ │ └── is-property@1.0.2 
  │ │ │ ├── protocol-buffers-schema@3.3.1 
  │ │ │ ├─┬ signed-varint@2.0.1 
  │ │ │ │ └── varint@5.0.0 
  │ │ │ └── varint@5.0.0 
  │ │ ├── readable-stream@2.2.9  deduped
  │ │ ├── sodium-universal@1.0.0  deduped
  │ │ └── varint@5.0.0 
  │ ├── inherits@2.0.3 
  │ ├── last-one-wins@1.0.4 
  │ ├── memory-pager@1.0.3 
  │ ├─┬ merkle-tree-stream@3.0.3 
  │ │ ├── flat-tree@1.6.0  deduped
  │ │ └── readable-stream@2.2.9  deduped
  │ ├─┬ random-access-file@1.7.2 
  │ │ ├── buffer-alloc-unsafe@1.0.0 
  │ │ ├─┬ debug@2.6.8 
  │ │ │ └── ms@2.0.0 
  │ │ ├── inherits@2.0.3  deduped
  │ │ ├─┬ mkdirp@0.5.1 
  │ │ │ └── minimist@0.0.8 
  │ │ └── thunky@1.0.2  deduped
  │ ├─┬ sodium-signatures@2.0.0 
  │ │ ├─┬ sodium-native@1.9.0 
  │ │ │ ├── nan@2.6.2 
  │ │ │ └── node-gyp-build@3.2.0 
  │ │ └── tweetnacl@0.14.5 
  │ ├─┬ sodium-universal@1.0.0 
  │ │ ├─┬ sodium-javascript@0.0.1 
  │ │ │ └── blakejs@1.1.0 
  │ │ └── sodium-native@1.9.0  deduped
  │ ├─┬ sparse-bitfield@3.0.3 
  │ │ └── memory-pager@1.0.3  deduped
  │ ├── thunky@1.0.2 
  │ ├── uint64be@2.0.1 
  │ ├── unordered-array-remove@1.0.2 
  │ └── unordered-set@2.0.0 
  ├─┬ hyperdiscovery@6.0.1 
  │ ├─┬ datland-swarm-defaults@1.0.2 
  │ │ └── xtend@4.0.1  deduped
  │ ├─┬ discovery-swarm@4.3.7 
  │ │ ├── buffer-equals@1.0.4  deduped
  │ │ ├── connections@1.4.2 
  │ │ ├── debug@2.6.8  deduped
  │ │ ├─┬ discovery-channel@5.4.3 
  │ │ │ ├─┬ bittorrent-dht@7.5.3 
  │ │ │ │ ├── bencode@0.11.0 
  │ │ │ │ ├── buffer-equals@1.0.4  deduped
  │ │ │ │ ├── debug@2.6.8  deduped
  │ │ │ │ ├── inherits@2.0.3  deduped
  │ │ │ │ ├─┬ k-bucket@3.2.1 
  │ │ │ │ │ ├── buffer-equals@1.0.4  deduped
  │ │ │ │ │ ├── inherits@2.0.3  deduped
  │ │ │ │ │ └── randombytes@2.0.3 
  │ │ │ │ ├─┬ k-rpc@4.0.2 
  │ │ │ │ │ ├── buffer-equals@1.0.4  deduped
  │ │ │ │ │ ├── k-bucket@3.2.1  deduped
  │ │ │ │ │ └─┬ k-rpc-socket@1.6.2 
  │ │ │ │ │   └── bencode@0.11.0  deduped
  │ │ │ │ ├─┬ lru@3.1.0 
  │ │ │ │ │ └── inherits@2.0.3  deduped
  │ │ │ │ └── safe-buffer@5.0.1  deduped
  │ │ │ ├── debug@2.6.8  deduped
  │ │ │ ├─┬ dns-discovery@5.6.0 
  │ │ │ │ ├── debug@2.6.8  deduped
  │ │ │ │ ├─┬ dns-socket@1.6.1 
  │ │ │ │ │ └─┬ dns-packet@1.1.1 
  │ │ │ │ │   ├── ip@1.1.5  deduped
  │ │ │ │ │   └── safe-buffer@5.0.1  deduped
  │ │ │ │ ├─┬ dns-txt@2.0.2 
  │ │ │ │ │ └── buffer-indexof@1.1.0 
  │ │ │ │ ├─┬ lru@2.0.1 
  │ │ │ │ │ └── inherits@2.0.3  deduped
  │ │ │ │ ├── minimist@1.2.0  deduped
  │ │ │ │ ├─┬ multicast-dns@6.1.1 
  │ │ │ │ │ ├── dns-packet@1.1.1  deduped
  │ │ │ │ │ └── thunky@0.1.0 
  │ │ │ │ ├── network-address@1.1.2 
  │ │ │ │ └── unordered-set@1.1.0 
  │ │ │ ├── pretty-hash@1.0.1 
  │ │ │ └── thunky@0.1.0 
  │ │ ├─┬ length-prefixed-message@3.0.3 
  │ │ │ └── varint@3.0.1 
  │ │ ├─┬ pump@1.0.2 
  │ │ │ ├─┬ end-of-stream@1.4.0 
  │ │ │ │ └── once@1.4.0  deduped
  │ │ │ └─┬ once@1.4.0 
  │ │ │   └── wrappy@1.0.2 
  │ │ ├── to-buffer@1.1.0 
  │ │ └─┬ utp-native@1.5.0 
  │ │   ├── nan@2.6.2  deduped
  │ │   ├── node-gyp-build@3.2.0  deduped
  │ │   └── readable-stream@2.2.9  deduped
  │ └── xtend@4.0.1 
  ├── is-async-supported@1.2.0 
  ├─┬ lowdb@0.16.2 
  │ ├── graceful-fs@4.1.11 
  │ ├── is-promise@2.1.0 
  │ ├── lodash@4.17.4 
  │ └─┬ steno@0.4.4 
  │   └── graceful-fs@4.1.11  deduped
  ├─┬ micro@7.3.2 
  │ ├─┬ args@2.6.0 
  │ │ ├── camelcase@4.1.0  deduped
  │ │ ├── chalk@1.1.3  deduped
  │ │ ├── minimist@1.2.0  deduped
  │ │ ├── pkginfo@0.4.0  deduped
  │ │ └── string-similarity@1.1.0  deduped
  │ ├─┬ async-to-gen@1.3.2 
  │ │ ├── babylon@6.17.1 
  │ │ └─┬ magic-string@0.19.1 
  │ │   └── vlq@0.2.2 
  │ ├── bluebird@3.5.0 
  │ ├─┬ boxen@1.0.0 
  │ │ ├─┬ ansi-align@1.1.0 
  │ │ │ └─┬ 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
  │ │ ├── camelcase@4.1.0  deduped
  │ │ ├── chalk@1.1.3  deduped
  │ │ ├── cli-boxes@1.0.0 
  │ │ ├─┬ string-width@2.0.0 
  │ │ │ ├── is-fullwidth-code-point@2.0.0 
  │ │ │ └── strip-ansi@3.0.1  deduped
  │ │ ├─┬ term-size@0.1.1 
  │ │ │ └─┬ execa@0.4.0 
  │ │ │   ├─┬ cross-spawn-async@2.2.5 
  │ │ │   │ ├── lru-cache@4.0.2  deduped
  │ │ │   │ └── which@1.2.14  deduped
  │ │ │   ├── is-stream@1.1.0  deduped
  │ │ │   ├─┬ npm-run-path@1.0.0 
  │ │ │   │ └── path-key@1.0.0  deduped
  │ │ │   ├── object-assign@4.1.1 
  │ │ │   ├── path-key@1.0.0 
  │ │ │   └── strip-eof@1.0.0  deduped
  │ │ └─┬ widest-line@1.0.0 
  │ │   └─┬ string-width@1.0.2 
  │ │     ├── code-point-at@1.1.0  deduped
  │ │     ├── is-fullwidth-code-point@1.0.0  deduped
  │ │     └── strip-ansi@3.0.1  deduped
  │ ├── chalk@1.1.3  deduped
  │ ├─┬ clipboardy@1.1.0 
  │ │ └─┬ execa@0.6.3 
  │ │   ├─┬ cross-spawn@5.1.0 
  │ │   │ ├─┬ lru-cache@4.0.2 
  │ │   │ │ ├── pseudomap@1.0.2 
  │ │   │ │ └── yallist@2.1.2 
  │ │   │ ├─┬ shebang-command@1.2.0 
  │ │   │ │ └── shebang-regex@1.0.0 
  │ │   │ └─┬ which@1.2.14 
  │ │   │   └── isexe@2.0.0 
  │ │   ├── get-stream@3.0.0 
  │ │   ├── is-stream@1.1.0 
  │ │   ├─┬ npm-run-path@2.0.2 
  │ │   │ └── path-key@2.0.1 
  │ │   ├── p-finally@1.0.0 
  │ │   ├── signal-exit@3.0.2 
  │ │   └── strip-eof@1.0.0 
  │ ├── get-port@3.1.0 
  │ ├── ip@1.1.5 
  │ ├── is-async-supported@1.2.0  deduped
  │ ├── isstream@0.1.2 
  │ ├── media-typer@0.3.0 
  │ ├── node-version@1.0.0  deduped
  │ ├─┬ raw-body@2.2.0 
  │ │ ├── bytes@2.4.0 
  │ │ ├── iconv-lite@0.4.15 
  │ │ └── unpipe@1.0.0 
  │ └── update-notifier@2.1.0  deduped
  ├─┬ micro-cors@0.0.4 
  │ ├─┬ 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.1 
  │ │ ├── forever-agent@0.6.1 
  │ │ ├─┬ form-data@2.1.4 
  │ │ │ ├── asynckit@0.4.0 
  │ │ │ ├── combined-stream@1.0.5  deduped
  │ │ │ └── mime-types@2.1.15  deduped
  │ │ ├─┬ har-validator@4.2.1 
  │ │ │ ├─┬ ajv@4.11.8 
  │ │ │ │ ├── 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.13.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.7 
  │ │ │   │ └── assert-plus@1.0.0 
  │ │ │   ├─┬ jodid25519@1.0.2 
  │ │ │   │ └── jsbn@0.1.1  deduped
  │ │ │   ├── jsbn@0.1.1 
  │ │ │   └── tweetnacl@0.14.5  deduped
  │ │ ├── is-typedarray@1.0.0 
  │ │ ├── isstream@0.1.2  deduped
  │ │ ├── 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 
  │ └─┬ request-promise@4.2.1 
  │   ├── bluebird@3.5.0  deduped
  │   ├─┬ request-promise-core@1.1.1 
  │   │ └── lodash@4.17.4  deduped
  │   ├── stealthy-require@1.1.1 
  │   └── tough-cookie@2.3.2  deduped
  ├── node-version@1.0.0 
  ├─┬ random-access-memory@2.4.0 
  │ └── process-nextick-args@1.0.7 
  ├─┬ sse-channel@2.0.6 
  │ ├─┬ access-control@1.0.0 
  │ │ ├── millisecond@0.1.2 
  │ │ ├─┬ setheader@0.0.4 
  │ │ │ └── debug@0.7.4 
  │ │ └── vary@1.1.1 
  │ ├── in-publish@2.0.0 
  │ └── lodash@4.17.4  deduped
  └─┬ update-notifier@2.1.0 
    ├── boxen@1.0.0  deduped
    ├── chalk@1.1.3  deduped
    ├─┬ configstore@3.1.0 
    │ ├─┬ dot-prop@4.1.1 
    │ │ └── is-obj@1.0.1 
    │ ├── graceful-fs@4.1.11  deduped
    │ ├─┬ make-dir@1.0.0 
    │ │ └── pify@2.3.0 
    │ ├─┬ unique-string@1.0.0 
    │ │ └── crypto-random-string@1.0.0 
    │ ├─┬ write-file-atomic@2.1.0 
    │ │ ├── graceful-fs@4.1.11  deduped
    │ │ ├── imurmurhash@0.1.4 
    │ │ └── slide@1.1.6 
    │ └── xdg-basedir@3.0.0  deduped
    ├── is-npm@1.0.0 
    ├─┬ latest-version@3.1.0 
    │ └─┬ package-json@4.0.1 
    │   ├─┬ got@6.7.1 
    │   │ ├─┬ create-error-class@3.0.2 
    │   │ │ └── capture-stack-trace@1.0.0 
    │   │ ├── duplexer3@0.1.4 
    │   │ ├── get-stream@3.0.0  deduped
    │   │ ├── is-redirect@1.0.0 
    │   │ ├── is-retry-allowed@1.1.0 
    │   │ ├── is-stream@1.1.0  deduped
    │   │ ├── lowercase-keys@1.0.0 
    │   │ ├── safe-buffer@5.0.1  deduped
    │   │ ├── timed-out@4.0.1 
    │   │ ├── unzip-response@2.0.1 
    │   │ └─┬ url-parse-lax@1.0.0 
    │   │   └── prepend-http@1.0.4 
    │   ├─┬ registry-auth-token@3.3.1 
    │   │ ├─┬ rc@1.2.1 
    │   │ │ ├── deep-extend@0.4.2 
    │   │ │ ├── ini@1.3.4 
    │   │ │ ├── minimist@1.2.0  deduped
    │   │ │ └── strip-json-comments@2.0.1 
    │   │ └── safe-buffer@5.0.1  deduped
    │   ├─┬ registry-url@3.1.0 
    │   │ └── rc@1.2.1  deduped
    │   └── semver@5.3.0  deduped
    ├── lazy-req@2.0.0 
    ├─┬ semver-diff@2.1.0 
    │ └── semver@5.3.0 
    └── xdg-basedir@3.0.0
fair-analytics
/home/user/.nvm/versions/node/v6.10.3/lib/node_modules/fair-analytics/lib/server.js:17
  async function storeLog (rawData) {
        ^^^^^^^^
SyntaxError: Unexpected token function
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/ilyar/.nvm/versions/node/v6.10.3/lib/node_modules/fair-analytics/node_modules/async-to-gen/register.js:42:5)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
vesparny commented 7 years ago

this happens because async/await is not supported in node 6. The best solution would be to use babel to transpile files before releasing a new version.

vesparny commented 7 years ago

@ilyar do you want to take care of this?

ilyar commented 7 years ago

No, unfortunately I have little experience with this.

vesparny commented 7 years ago

ok no worries, I will take a look ASAP.

vesparny commented 7 years ago

@ilyar I just released v1.1.0

can you please give it a try and tell me if fixes your issue?

Thanks

ilyar commented 7 years ago

Thanks, all ok.