Amazebot / bbot-rocketchat-boilerplate

bRocket is a bBot boilerplate for building Rocket.Chat bots
MIT License
13 stars 8 forks source link

SyntaxError: Unexpected token function (init.js) #2

Open rocapp opened 5 years ago

rocapp commented 5 years ago

I tried following the instructions for testing, and it failed on npm run setup. It's possible I did something dumb. I don't know anything about Node.js. Below is the log output.

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'setup' ] 2 info using npm@3.10.10 3 info using node@v6.11.2 4 verbose run-script [ 'presetup', 'setup', 'postsetup' ] 5 info lifecycle brocket-demo@1.0.0~presetup: brocket-demo@1.0.0 6 silly lifecycle brocket-demo@1.0.0~presetup: no script for presetup, continuing 7 info lifecycle brocket-demo@1.0.0~setup: brocket-demo@1.0.0 8 verbose lifecycle brocket-demo@1.0.0~setup: unsafe-perm in lifecycle true 9 verbose lifecycle brocket-demo@1.0.0~setup: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/rocapp/Git/bbot-rocketchat-boilerplate/node_modules/.bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin 10 verbose lifecycle brocket-demo@1.0.0~setup: CWD: /home/rocapp/Git/bbot-rocketchat-boilerplate 11 silly lifecycle brocket-demo@1.0.0~setup: Args: [ '-c', 'node init.js' ] 12 silly lifecycle brocket-demo@1.0.0~setup: Returned: code: 1 signal: null 13 info lifecycle brocket-demo@1.0.0~setup: Failed to exec setup script 14 verbose stack Error: brocket-demo@1.0.0 setup: node init.js 14 verbose stack Exit status 1 14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at EventEmitter.emit (events.js:191:7) 14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at ChildProcess.emit (events.js:191:7) 14 verbose stack at maybeClose (internal/child_process.js:891:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 15 verbose pkgid brocket-demo@1.0.0 16 verbose cwd /home/rocapp/Git/bbot-rocketchat-boilerplate 17 error Linux 4.15.0-42-generic 18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "setup" 19 error node v6.11.2 20 error npm v3.10.10 21 error code ELIFECYCLE 22 error brocket-demo@1.0.0 setup: node init.js 22 error Exit status 1 23 error Failed at the brocket-demo@1.0.0 setup script 'node init.js'. 23 error Make sure you have the latest version of node.js and npm installed. 23 error If you do, this is most likely a problem with the brocket-demo package, 23 error not with npm itself. 23 error Tell the author that this fails on your system: 23 error node init.js 23 error You can get information on how to open an issue for this project with: 23 error npm bugs brocket-demo 23 error Or if that isn't available, you can get their info via: 23 error npm owner ls brocket-demo 23 error There is likely additional logging output above. 24 verbose exit [ 1, true ]

timkinnane commented 5 years ago

@rocapp I don't know what to make of that. It might be your node version 🤷‍♂️ Node 6 is approaching end of life, I would recommend updating to Node 8.

The setup script is not crucial. It mostly just sets the environment variables in a .env file by copying from the provided .env.example. So you can try doing that manually, then proceed to the next steps, but you may continue to have issues with Node 6, I haven't tested for it.