question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

If you are like me, it’s nice to dig around and follow along when source code is provided. There were a couple hurdles getting running on this one so I figured I’d share.

Server side

This is using a newer-ish version node.js 's import syntax so you will need to use nvm to swap over to somewhere around 15.8.0 using nvm. You can install nvm using:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

Once installed:

nvm install 15.8.0

Simon seems to have removed server/package.json. I was able to fill in the blanks and this worked fine for me:

{
  "name": "server",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "gl-matrix": "^3.3.0",
    "socket.io": "^3.1.1"
  },
  "scripts": {
    "start": "node index.mjs"
  }
}

Once you have that set done you can run the following to start the server:

npm install
node index.mjs

Leave this running in a separate terminal.

Client side

Install http-server

sudo npm install -g http-server

Then run a simple http-server to serve up the files. If you don’t do this you will get CORS issues.

$ http-server
Starting up http-server, serving ./
Available on:
  http://127.0.0.1:8081
  http://192.168.1.129:8081
  http://10.0.7.10:8081
  http://192.168.96.1:8081
Hit CTRL-C to stop the server

I was able to see the login screen, walk around and kill some monsters named after my username lol.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:21
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ITAndy23commented, Mar 20, 2021

@Unusualiscool What did you do to get the websocket error? After you built the package.json inside the server folder per @Addyvan instructions, you should run npm install via command prompt while in the server directory. That should install what you need. Then run npm start while in that directory. Leave that running. In a new command prompt window, change directory over to the client folder and run: npm install -g http-server Then run http-server The window will tell you the url and port you can hit from your browser. For me it was, http://127.0.0.1:8080/

1reaction
phamvietdungcommented, Aug 24, 2021

@Addyvan you’re savior

Read more comments on GitHub >

github_iconTop Results From Across the Web

a-ha - I'm In (Official Video) - YouTube
Listen to the new single " I'm In ": https://a-ha.lnk.to/ImInPre Order the new album "True North": https://a-ha.lnk.to/TrueNorthAt ...
Read more >
I'm In
"I'm In" is a song co-written and recorded by American country music singer Radney Foster. He recorded it on his 1999 studio album...
Read more >
I'm in
A phrase used by an individual in a group suddenly determined to resolve a task or meaningless puzzle (that the others are too...
Read more >
Im-in GIFs - Get the best GIF on GIPHY
Explore and share the best Im-in GIFs and most popular animated GIFs here on GIPHY. Find Funny GIFs, Cute GIFs, Reaction GIFs and...
Read more >
spoken english - "I'm in" meaning?
The expression "I'm in" or "count me in" mean that you wish to be included in a proposed activity. For example: "I'm going...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found