Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Error? #2

Open
pulliam opened this issue Apr 10, 2017 · 9 comments
Open

Syntax Error? #2

pulliam opened this issue Apr 10, 2017 · 9 comments

Comments

@pulliam
Copy link

pulliam commented Apr 10, 2017

Hi, I am getting an issue that looks like this:

(function (exports, require, module, __filename, __dirname) { const {PORT, SCOPE, CLIENT_ID, CLIENT_SECRET, TOKEN, STORE, SLASH_COMMAND} = process.env,
                                                                ^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:146:18)
at node.js:404:3

Any Ideas on how to fix it?

Thank you!

@johnagan
Copy link
Owner

@pulliam It's probably your node version. I forgot to add the engine to the package.json, but I think those operators come in around 6.x. You may want to double check.

If I make it back around to this project, I plan to flush out a better example here: https://github.com/johnagan/servicenow-bot-example/tree/istanbul-rewrite

@pulliam
Copy link
Author

pulliam commented Apr 19, 2017

I updated mine to the most current one (v6.10.2) and is still giving me the same error... The npm-debug.log file gave me this:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@3.10.10
3 info using node@v6.10.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle servicenow-bot-example@1.0.0~prestart: servicenow-bot-example@1.0.0
6 silly lifecycle servicenow-bot-example@1.0.0~prestart: no script for prestart, continuing
7 info lifecycle servicenow-bot-example@1.0.0~start: servicenow-bot-example@1.0.0
8 verbose lifecycle servicenow-bot-example@1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle servicenow-bot-example@1.0.0~start: PATH: 
/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/thais/slack-bot/servicenow-bot-example/node_modules/.bin:/Users/thais/.rbenv/shims:/usr/local/heroku/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/Users/thais/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
10 verbose lifecycle servicenow-bot-example@1.0.0~start: CWD: /Users/thais/slack-bot/servicenow-bot-example
11 silly lifecycle servicenow-bot-example@1.0.0~start: Args: [ '-c', 'node index.js' ]
12 silly lifecycle servicenow-bot-example@1.0.0~start: Returned: code: 1  signal: null
13 info lifecycle servicenow-bot-example@1.0.0~start: Failed to exec start script
14 verbose stack Error: servicenow-bot-example@1.0.0 start: `node index.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> 
(/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.<anonymous> 
(/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:886:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid servicenow-bot-example@1.0.0
16 verbose cwd /Users/thais/slack-bot/servicenow-bot-example
 17 error Darwin 16.5.0
 18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
 19 error node v6.10.2
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error servicenow-bot-example@1.0.0 start: `node index.js`
22 error Exit status 1
23 error Failed at the servicenow-bot-example@1.0.0 start script 'node index.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 servicenow-bot-example package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     node index.js
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs servicenow-bot-example
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls servicenow-bot-example
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

If you know what could be happening to it, give me a shout.

Thanks

@johnagan
Copy link
Owner

@pulliam looks like a new error this time 🤔

@pulliam
Copy link
Author

pulliam commented Apr 19, 2017

If helpful at all, this is what I am getting on the terminal side:

> servicenow-bot-example@1.0.0 start /Users/thais/slack-bot/servicenow-bot-example
> node index.js

/Users/thais/slack-bot/servicenow-bot-example/node_modules/express-slack/src/controller.js:24
this.store.all().then(auths => {
          ^

TypeError: Cannot read property 'all' of undefined
    at Controller (/Users/thais/slack-bot/servicenow-bot-example/node_modules/express-slack/src/controller.js:24:15)
    at slack (/Users/thais/slack-bot/servicenow-bot-example/node_modules/express-slack/src/index.js:17:16)
    at Object.<anonymous> (/Users/thais/slack-bot/servicenow-bot-example/index.js:8:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:393:7)

npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! servicenow-bot-example@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the servicenow-bot-example@1.0.0 start script 'node index.js'.
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 servicenow-bot-example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs servicenow-bot-example
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls servicenow-bot-example
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/thais/slack-bot/servicenow-bot-example/npm-debug.log

@johnagan
Copy link
Owner

@pulliam have you set the STORE environment variable?

@pulliam
Copy link
Author

pulliam commented Apr 19, 2017

Yes.. I have a process.env file and using the package dotenv ...
"STORE=data/teams.json"
Not sure if I am setting that wrong for some reason

@johnagan
Copy link
Owner

johnagan commented Apr 19, 2017

@pulliam not sure 🤔 maybe debug your code to make sure those values are being set?

If you have a project on github, you can add me to it and I can check it out for you. It's also possible this sample project is broken too. I'm working on a rewrite since there has been more interest lately

@reubenwatts
Copy link

Having the same issue - did you resolve this or rewrite?

@Neyadav2
Copy link

Hi
I'm seeing following error

Neerajs-MacBook-Air:servicenow-bot-example-master neeraj$ npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/neeraj/Desktop/Confidential/neyadav2/SRE/servicenow-bot-example-master/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/neeraj/Desktop/Confidential/neyadav2/SRE/servicenow-bot-example-master/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/neeraj/.npm/_logs/2019-12-10T09_45_51_075Z-debug.log
Neerajs-MacBook-Air:servicenow-bot-example-master neeraj$ cat /Users/neeraj/.npm/_logs/2019-12-10T09_45_51_075Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@6.11.3
3 info using node@v8.11.4
4 verbose stack Error: ENOENT: no such file or directory, open '/Users/neeraj/Desktop/Confidential/neyadav2/SRE/servicenow-bot-example-master/package.json'
5 verbose cwd /Users/neeraj/Desktop/Confidential/neyadav2/SRE/servicenow-bot-example-master
6 verbose Darwin 19.0.0
7 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
8 verbose node v8.11.4
9 verbose npm v6.11.3
10 error code ENOENT
11 error syscall open
12 error path /Users/neeraj/Desktop/Confidential/neyadav2/SRE/servicenow-bot-example-master/package.json
13 error errno -2
14 error enoent ENOENT: no such file or directory, open '/Users/neeraj/Desktop/Confidential/neyadav2/SRE/servicenow-bot-example-master/package.json'
15 error enoent This is related to npm not being able to find a file.
16 verbose exit [ -2, true ]
Neerajs-MacBook-Air:servicenow-bot-example-master neeraj$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants