Code seems to have errors
JamieBNU opened this issue ยท 6 comments
This is a great project and learning a lot. I've followed the instructions exactly as they outline, but it does not seem to work.
Can someone please help me figure out why it is not running?
I am getting this output:
0 info it worked if it ends with ok
1 verbose cli [ '/home/ubuntu/.nvm/versions/node/v4.7.3/bin/node',
1 verbose cli '/home/ubuntu/.nvm/versions/node/v4.7.3/bin/npm',
1 verbose cli 'start' ]
2 info using npm@2.15.11
3 info using node@v4.7.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart twitter-bot-bootstrap@0.2.1
6 info start twitter-bot-bootstrap@0.2.1
7 verbose unsafe-perm in lifecycle true
8 info twitter-bot-bootstrap@0.2.1 Failed to exec start script
9 verbose stack Error: twitter-bot-bootstrap@0.2.1 start: `node index.js`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (/home/ubuntu/.nvm/versions/node/v4.7.3/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess.<anonymous> (/home/ubuntu/.nvm/versions/node/v4.7.3/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:854:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:222:5)
10 verbose pkgid twitter-bot-bootstrap@0.2.1
11 verbose cwd /home/ubuntu/workspace/twitter-bot-bootstrap
12 error Linux 4.9.17-c9
13 error argv "/home/ubuntu/.nvm/versions/node/v4.7.3/bin/node" "/home/ubuntu/.nvm/versions/node/v4.7.3/bin/npm" "start"
14 error node v4.7.3
15 error npm v2.15.11
16 error code ELIFECYCLE
17 error twitter-bot-bootstrap@0.2.1 start: `node index.js`
17 error Exit status 1
18 error Failed at the twitter-bot-bootstrap@0.2.1 start script 'node index.js'.
18 error This is most likely a problem with the twitter-bot-bootstrap package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error node index.js
18 error You can get information on how to open an issue for this project with:
18 error npm bugs twitter-bot-bootstrap
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls twitter-bot-bootstrap
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
HI @JamieBNU are you able to tell me where this is happening, at what stage in the walk through are you and what commands did you enter, looks like maybe npm run start
?
Have you npm install
ed everything? and are you in the working directory?
Thanks ๐
Thanks! Yes, I'm at the part of the tutorial where it tells us to run the command 'npm start' in the /home/ubuntu/workspace/twitter-bot-bootstrap/ directory. But then it gives me the error log above.
Not sure what to do! Many thanks for your help!
I also get this:
b2jamie:~/workspace/twitter-bot-bootstrap (master) $ npm start
twitter-bot-bootstrap@0.2.1 start /home/ubuntu/workspace/twitter-bot-bootstrap
node index.js
/home/ubuntu/workspace/twitter-bot-bootstrap/src/api/retweet.js:26
let retweetId
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/ubuntu/workspace/twitter-bot-bootstrap/src/bot.js:9:17)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/ubuntu/workspace/twitter-bot-bootstrap/index.js:1:63)
at Module._compile (module.js:409:26)
npm ERR! Linux 4.9.17-c9
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.7.3/bin/node" "/home/ubuntu/.nvm/versions/node/v4.7.3/bin/npm" "start"
npm ERR! node v4.7.3
npm ERR! npm v2.15.11
npm ERR! code ELIFECYCLE
npm ERR! twitter-bot-bootstrap@0.2.1 start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the twitter-bot-bootstrap@0.2.1 start script 'node index.js'.
npm ERR! This is most likely a problem with the twitter-bot-bootstrap 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 twitter-bot-bootstrap
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls twitter-bot-bootstrap
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/workspace/twitter-bot-bootstrap/npm-debug.log
Ok, so for:
let retweetId
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
You'll need to add "use strict";
at the top of the file where the error is coming from, taker a look at: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Strict_mode
For the npm
script try npm run start
not npm start
if that doesn't work try running the bot
file against node directly, so something like:
node path/to/the/bot.js
See what the output is ๐
Hooray! Thank you! It runs - but now I am getting the error "ERRORDERP: Cannot assign retweeID"
Getting there!
That's the logging, usually occurs when the tweet is has already been retweted. ๐