Ask coding questions

← Back to all posts
How to use peerjs
coding1001

How do I use Peerjs in a nodejs REPL. To Use Peerjs you usually have to use npm i -g peer to install and then use peerjs --port 3001. install-pkg does not work in nodejs REPLs. How do i install peerjs?

Voters
coding1001
Comments
hotnewtop
TheBest156

Here, Hope this helps. https://peerjs.com/docs.html

coding1001

@JohnBarnhart i need to use the peerjs command in the terminal

TheBest156

@coding1001 Ok, breaking it into different parts.

what are you using it for on your project?

coding1001

@TheBest156 i'm trying to use webRTC from this tutorial: https://www.youtube.com/watch?v=DvlyzDZDEq4

TheBest156

@coding1001 Hold on, gotta eat lunch, I'll help you later.

TheBest156

@TheBest156 I Promise

coding1001

@TheBest156 u there?

TheBest156

@coding1001 got school work to do in classes and exams all day. maybe later if I got time around 5 pm or 4 pm eastern time.

coding1001

@TheBest156 my code works on my computer with:
sudo npm i -g peer
peerjs —port 3001
node server.js
The problem is it is only on localhost and I want to access it from any device, not just the ones connected to my network

TheBest156
coding1001

@TheBest156 how do i use it in replit?

TheBest156

@coding1001 can I edit it to try to help?

coding1001

@TheBest156 the REPL? Should I invite you to it?

TheBest156

@coding1001 sure, Don't have much time, only got 10-15 minutes left until next class in school.

coding1001

@TheBest156 invited you

TheBest156

@coding1001 k, hold on