sentanos / roblox-js-server

(THIS SERVER IS UNSECURE - USE AT YOUR OWN RISK) Example server using roblox-js module
31 stars 48 forks source link

Encountering Error when trying to run JS File. #11

Closed jam10161 closed 7 years ago

jam10161 commented 7 years ago

Hello! I am currently trying to get this to work. I set up everything. At the moment, I am currently stuck. I already went through the tutorial. I now need to know how I start my server. I already tried running the JS file, and it won't start. I always end up getting an Unexpected Identifier Error. If you could assist me with this, that would be great.

jam10161 commented 7 years ago

@sentanos

sentanos commented 7 years ago

Please clarify, where are you running this and post the complete error.

jam10161 commented 7 years ago

I am trying to run it in CMD.

jam10161 commented 7 years ago

ethan@ethan-X502CA:~/roblox-js-server-master$ npm start server.js npm ERR! Error: ENOENT, open '/home/ethan/roblox-js-server-master/node_modules/server.js/package.json' npm ERR! If you need help, you may report this entire log, npm ERR! including the npm and node versions, at: npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 4.2.0-42-generic npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "start" "server.js" npm ERR! cwd /home/ethan/roblox-js-server-master npm ERR! node -v v0.10.25 npm ERR! npm -v 1.4.21 npm ERR! path /home/ethan/roblox-js-server-master/node_modules/server.js/package.json npm ERR! code ENOENT npm ERR! errno 34 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/ethan/roblox-js-server-master/npm-debug.log npm ERR! not ok code 0 ethan@ethan-X502CA:~/roblox-js-server-master$

sentanos commented 7 years ago

You are misunderstanding how node works, you would start the server manually with the command node server.js

jam10161 commented 7 years ago

It doesn't seem to matter what I try, I keep getting an error. module.js:340 throw err; ^ Error: Cannot find module 'express' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/home/ethan/roblox-js-server-master/server.js:1:77) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10)

sentanos commented 7 years ago

You have to do npm install before that, have you even used nodejs before?

jam10161 commented 7 years ago

I have.

jam10161 commented 7 years ago

2017-01-18T05:47:09.208384+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:

2017-01-18T05:47:09.208383+00:00 app[web.1]: npm ERR! node server.js

2017-01-18T05:47:09.208385+00:00 app[web.1]: npm ERR! npm bugs roblox-js-server

2017-01-18T05:47:09.208385+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:

2017-01-18T05:47:09.208386+00:00 app[web.1]: npm ERR! npm owner ls roblox-js-server

2017-01-18T05:47:09.208387+00:00 app[web.1]: npm ERR! There is likely additional logging output above.

2017-01-18T05:47:09.212502+00:00 app[web.1]:

2017-01-18T05:47:09.212506+00:00 app[web.1]: npm ERR! Please include the following file with any support request:

2017-01-18T05:47:09.212506+00:00 app[web.1]: npm ERR! /app/npm-debug.log

2017-01-18T05:47:09.311065+00:00 heroku[web.1]: State changed from starting to crashed

2017-01-18T05:47:09.306048+00:00 heroku[web.1]: Process exited with status 1

jam10161 commented 7 years ago

I am highly confused at the moment.

jam10161 commented 7 years ago

ode server.js Listening Http error: RequestError: Error: UNABLE_TO_GET_ISSUER_CERT_LOCALLY at new RequestError (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/request-promise/lib/errors.js:14:15) at Request.RP$callback [as _callback] (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/request-promise/lib/rp.js:60:25) at self.callback (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/request-promise/node_modules/request/request.js:186:22) at Request.EventEmitter.emit (events.js:95:17) at Request.onRequestError (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/request-promise/node_modules/request/request.js:845:8) at ClientRequest.EventEmitter.emit (events.js:95:17) at CleartextStream.socketErrorListener (http.js:1547:9) at CleartextStream.EventEmitter.emit (events.js:95:17) at SecurePair. (tls.js:1389:19) at SecurePair.EventEmitter.emit (events.js:92:17) at SecurePair.maybeInitFinished (tls.js:982:10) at CleartextStream.read [as _read] (tls.js:469:13) at CleartextStream.Readable.read (_stream_readable.js:320:10) at EncryptedStream.write [as _write] (tls.js:366:25) at doWrite (_stream_writable.js:223:10) at writeOrBuffer (_stream_writable.js:213:5) at EncryptedStream.Writable.write (_stream_writable.js:180:11) at write (_stream_readable.js:583:24) at flow (_stream_readable.js:592:7) at Socket.pipeOnReadable (_streamreadable.js:624:5) at Socket.EventEmitter.emit (events.js:92:17) at emitReadable (_stream_readable.js:408:10) Unhandled rejection TypeError: Cannot read property 'body' of undefined at /home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/lib/util/login.js:32:21 at tryCatcher (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/bluebird/js/release/promise.js:510:31) at Promise._settlePromise (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/bluebird/js/release/promise.js:567:18) at Promise._settlePromise0 (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/bluebird/js/release/promise.js:612:10) at Promise._settlePromises (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/bluebird/js/release/promise.js:691:18) at Async._drainQueue (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/bluebird/js/release/async.js:133:16) at Async._drainQueues (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/bluebird/js/release/async.js:143:10) at Async.drainQueues (/home/ethan/Desktop/roblox-js-server-master/node_modules/roblox-js/node_modules/bluebird/js/release/async.js:17:14) at process._tickCallback (node.js:415:13)

sentanos commented 7 years ago

These are problems with your server setup, not the script itself. If you do not know enough about node to deal with these problems then you should stick to the host tutorial. Otherwise, this is not my problem.

jam10161 commented 7 years ago

I did stick to the host setup. I did everything it said. All I am concerned about is how to start it, but I always end up getting issues. I would also like to know how to remotely send the commands to Roblox.

sentanos commented 7 years ago

Then you are misunderstanding how it works, you are pushing to a remote server, not your local machine. If you did everything it said it is already running on a web URL that you can even visit in your browser, there is nothing else to do. There is a lua example section that details how to send requests to ROBLOX and is made to work with the free host setup.

jam10161 commented 7 years ago

Whenever I visit the link, it gives me an error, something about, Cannot GET/

sentanos commented 7 years ago

That is not an error, that is correct functionality. When you run POST requests via ROBLOX it will work execute functions, otherwise it has nothing to do.

jam10161 commented 7 years ago

And, I have tried the whole script thing. Whenever I go into an F7 Server in Roblox Studio, It doesn't run the script in ServerScriptService.

sentanos commented 7 years ago

You have the module and a regular script in ServerScriptService? Are there no errors?

jam10161 commented 7 years ago

Nope. None\

jam10161 commented 7 years ago

And, Yep. I do.

jam10161 commented 7 years ago

I followed everything, and still couldn't get it to function right.

sentanos commented 7 years ago

It does not make any sense for there to be no messages in output. Until you can provide me with more information, there is no possible way for me to help you.

jam10161 commented 7 years ago

Okay. Well, I will provide it tommorow.

jam10161 commented 7 years ago

I have to go now.

jam10161 commented 7 years ago

Okay. I got some more infomation. Everytime, I go into the F7 Server Mode on Studio, I recieve this in my Heroku Logs. 2017-01-19T00:05:58.340350+00:00 heroku[router]: at=info method=POST path="/message/97997712" host=applicationcenter.herokuapp.com request_id=3849cbdd-dbe5-4062-94ef-f61de94069e8 fwd="173.187.32.58" dyno=web.1 connect=1ms service=2ms status=200 bytes=252


Then, in the output, this is what I recieve, 19:10:45.860 - ! Joining game '00000000-0000-0000-0000-000000000000' place 0 at localhost 19:10:45.863 - Connecting to localhost:53640 19:10:45.866 - Connection accepted from 127.0.0.1|53640

jam10161 commented 7 years ago

@sentanos

sentanos commented 7 years ago

What about in play mode?

jam10161 commented 7 years ago

Already attempted it.

jam10161 commented 7 years ago

Already attempted it.

jam10161 commented 7 years ago

@sentanos

sentanos commented 7 years ago

Replace your module file with this and tell me the output after running.

jam10161 commented 7 years ago

I will test it when I get home.

jam10161 commented 7 years ago

21:37:31.536 - ! Joining game '00000000-0000-0000-0000-000000000000' place 0 at localhost 21:37:33.214 - Connecting to localhost:53640 21:37:33.217 - Unable to find module for asset id 21:37:33.218 - Stack Begin 21:37:33.220 - Script 'Plugin_336234311.Folder.Script.HENNYCHECKIN.Self Check-In.CLICKBtton.Gui.Check.Middle.three.TextButton.Script', Line 1 21:37:33.222 - Stack End 21:37:33.223 - Unable to find module for asset id 21:37:33.224 - Stack Begin 21:37:33.224 - Script 'Plugin_336234311.Folder.Script.HENNYCHECKIN.Self Check-In.CLICKBtton.Gui.Check.Middle.two.TextButton.Script', Line 1 21:37:33.225 - Stack End 21:37:33.226 - Unable to find module for asset id 21:37:33.227 - Stack Begin 21:37:33.228 - Script 'Plugin_336234311.Folder.Script.HENNYCHECKIN.Self Check-In.CLICKBtton.Gui.Check.Middle.one.TextButton.Script', Line 1 21:37:33.229 - Stack End 21:37:34.387 - Connection accepted from 127.0.0.1|53640

21:37:44.375 - Infinite yield possible on 'Plugin_218303841.Model.GUIs.SignalGUI.Scripts:WaitForChild("Mode")' 21:37:44.377 - Stack Begin 21:37:44.379 - Script 'Plugin_218303841.Model.GUIs.SignalGUI.Scripts.4', Line 11 21:37:44.380 - Stack End 21:37:44.381 - Infinite yield possible on 'Plugin_218303841.Model.GUIs.SignalGUI.Scripts:WaitForChild("Mode")' 21:37:44.383 - Stack Begin 21:37:44.384 - Script 'Plugin_218303841.Model.GUIs.SignalGUI.Scripts.3', Line 10 21:37:44.385 - Stack End

sentanos commented 7 years ago

What are these other things? Could you please only use the exact example Lua script as in the tutorial, do not put anything else.

jam10161 commented 7 years ago

Okay. Let me see.

jam10161 commented 7 years ago

21:44:44.197 - ! Joining game '00000000-0000-0000-0000-000000000000' place 0 at localhost 21:44:44.203 - Connecting to localhost:53640 21:44:44.205 - Connection accepted from 127.0.0.1|53640

jam10161 commented 7 years ago

@sentanos

sentanos commented 7 years ago

It is literally impossible for the POST request to be made and for nothing to be posted in the output. If you don't believe me read the code yourself. I can only conclude that you have some mistake with your setup and that is not my business. If you can prove to me there is a problem with the project I will entertain an issue post, otherwise I am done wasting my time with this.

jam10161 commented 7 years ago

How do I get it to login to my bot account?

jam10161 commented 7 years ago

@sentanos

jam10161 commented 7 years ago

Unhandled rejection Error: Credentials 2017-01-19T03:39:52.977166+00:00 app[web.1]: at /app/node_modules/roblox-js/lib/util/login.js:43:16 2017-01-19T03:39:52.977167+00:00 app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23) 2017-01-19T03:39:52.977168+00:00 app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:510:31) 2017-01-19T03:39:52.977169+00:00 app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:567:18) 2017-01-19T03:39:52.977170+00:00 app[web.1]: at Promise._settlePromise0 (/app/node_modules/bluebird/js/release/promise.js:612:10) 2017-01-19T03:39:52.977171+00:00 app[web.1]: at Promise._settlePromises (/app/node_modules/bluebird/js/release/promise.js:691:18) 2017-01-19T03:39:52.977171+00:00 app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:133:16) 2017-01-19T03:39:52.977172+00:00 app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10) 2017-01-19T03:39:52.977173+00:00 app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14) 2017-01-19T03:39:52.977173+00:00 app[web.1]: at runCallback (timers.js:637:20) 2017-01-19T03:39:52.977174+00:00 app[web.1]: at tryOnImmediate (timers.js:610:5) 2017-01-19T03:39:52.977174+00:00 app[web.1]: at processImmediate [as _immediateCallback] (timers.js:582:5)

sentanos commented 7 years ago

You did not put the correct username and password in the config...

sentanos commented 7 years ago

Please put some effort into actually reading and following the documentation or I will not put effort into responding. I am now unsubscribing to this thread and will not respond to further messages.