ESCAPE98 Posted September 15, 2019 Report Share Posted September 15, 2019 (edited) Salut, in acest tutorial o sa arat cum putem face un ChatRoom (Cu tot cu host). Pasul 1 - Ne facem cont pe Repl.It (Ne putem loga si cu gmail). Eu am un cont facut special pentru tutoriale pe acest forum. Link: https://repl.it/ Pasul 2 - Facem un repl de Nodejs si il numim "server" (sau ce nume vrem). Pasul 3 - Pe langa index.js facem 2 fisiere numite: package-lock.json; package.json. Pasul 4 - In index.js copypaste la urmatorul cod: https://pastebin.com/pfNEcACv Pasul 5 - In package-lock.json copypaste la urmatorul cod: https://pastebin.com/2dRvEwvt Pasul 6 - In package.json copypaste la urmatorul cod: https://pastebin.com/Fjg073BQ Pasul 7 - Dam run la repl-u' nostru, asteptam sa instaleze tot ce e de instalat si dupa ce termina copiam linku' de la repl-u' nostru (o sa avem nevoie de el mai tarziu): Pasul 8 - Mai facem un repl de nodejs si il numim "ChatRoom" (sau ce nume vrem). Pasul 9 - Pe langa index.js facem 2 fisiere numite: package-lock.json; package.json. Pasul 10 - In index.js copypaste la urmatorul cod: https://pastebin.com/a5j9MPNa Pe linia de cod 4 unde scrie: var socket = io("Link"); in loc de "link" punem link-u' de la repl-u' ce-l facusem inainte. (Repl-u' cu numele server sau ce nume a-ti pus). Pasul 11 - In package-lock.json copypaste la urmatorul cod: https://pastebin.com/sABUuGCB Pasul 12 - In package.json copypaste la urmatorul cod: https://pastebin.com/xtgv9pMr GATA DAM RUN SI DESCHIDEM LINK-U DE LA REPL-U' "CHATROOM" SAU CUM L-ATI NUMIT. SI IL DAM PERSOANEI CU CARE VREM SA COMUNICAM PE ACEL CHATROOM LINK DE LA CHATROOM-UL CE L-AM FACUT PENTRU ACEST TUTORIAL: https://chatroom.tutorialerepl.repl.run/ Edited September 15, 2019 by ESCAPE98 1 2 Quote Link to comment Share on other sites More sharing options...
c3m3d3 Posted September 15, 2019 Report Share Posted September 15, 2019 Poti sa ne explici te rog, de ce ar fi nevoie si de package.json daca ai deja un package-lock.json? Quote Link to comment Share on other sites More sharing options...
ESCAPE98 Posted September 15, 2019 Author Report Share Posted September 15, 2019 26 minutes ago, c3m3d3 said: Poti sa ne explici te rog, de ce ar fi nevoie si de package.json daca ai deja un package-lock.json? "npm ERR! Unexpected token { in JSON at position 10872 while parsing near '...KxBk=" npm ERR! } npm ERR! } npm ERR! } npm ERR! npm ERR! { npm ERR! "main": "index.j...' npm ERR! A complete log of this run can be found in: npm ERR! /home/runner/.npm/_logs/2019-09-15T14_40_55_530Z-debug.log Repl.it: package installation failed!" De-asta. Quote Link to comment Share on other sites More sharing options...
c3m3d3 Posted September 15, 2019 Report Share Posted September 15, 2019 Just now, ESCAPE98 said: "npm ERR! Unexpected token { in JSON at position 10872 while parsing near '...KxBk=" npm ERR! } npm ERR! } npm ERR! } npm ERR! npm ERR! { npm ERR! "main": "index.j...' npm ERR! A complete log of this run can be found in: npm ERR! /home/runner/.npm/_logs/2019-09-15T14_40_55_530Z-debug.log Repl.it: package installation failed!" De-asta. Aha, si ce-nseamna asta? Quote Link to comment Share on other sites More sharing options...
ESCAPE98 Posted September 15, 2019 Author Report Share Posted September 15, 2019 (edited) 39 minutes ago, c3m3d3 said: Poti sa ne explici te rog, de ce ar fi nevoie si de package.json daca ai deja un package-lock.json? Dar mai pe scurt package.json ofera o varianta ez de a "urmări" pachetele care sunt utilizate în aplicație/program. " { "main": "index.js", "dependencies": { "socket.io-client": "2.1.1", "chalk": "2.4.1", "prompts": "1.2.0" } } " wow Edited September 15, 2019 by ESCAPE98 1 Quote Link to comment Share on other sites More sharing options...
c3m3d3 Posted September 15, 2019 Report Share Posted September 15, 2019 Just now, ESCAPE98 said: Dar mai pe scurt package.json ofera o varianta ez de a "urmări" pachetele care sunt utilizate în aplicație. " { "main": "index.js", "dependencies": { "socket.io-client": "2.1.1", "chalk": "2.4.1", "prompts": "1.2.0" } } " wow Aha, si package-lock.json ce face? Puneti ba mana si invatati ce fac tool-urile pe care le folositi. Voi chiar puteti sa fiti multumiti de voi in halul asta? 1 Quote Link to comment Share on other sites More sharing options...
ESCAPE98 Posted September 15, 2019 Author Report Share Posted September 15, 2019 15 minutes ago, c3m3d3 said: Aha, si package-lock.json ce face? Puneti ba mana si invatati ce fac tool-urile pe care le folositi. Voi chiar puteti sa fiti multumiti de voi in halul asta? Bun ia spune-mi si mie ce fac tool-urile pe care le-am folosit in acest tutorial, sa fiu si eu multumit de mine. Quote Link to comment Share on other sites More sharing options...
giraffedev Posted September 15, 2019 Report Share Posted September 15, 2019 (edited) Esti un terminat daca dupa ce ti-am dat downvote ai inceput sa creezi conturi sa imi dai downvote. Fa ceva cu viata ta Edited September 15, 2019 by giraffedev 1 Quote Link to comment Share on other sites More sharing options...
mDOS Posted September 15, 2019 Report Share Posted September 15, 2019 7 hours ago, ESCAPE98 said: Salut, in acest tutorial o sa arat cum putem face un ChatRoom (Cu tot cu host). Pasul 1 - Ne facem cont pe Repl.It (Ne putem loga si cu gmail). Eu am un cont facut special pentru tutoriale pe acest forum. Link: https://repl.it/ Pasul 2 - Facem un repl de Nodejs si il numim "server" (sau ce nume vrem). Pasul 3 - Pe langa index.js facem 2 fisiere numite: package-lock.json; package.json. Pasul 4 - In index.js copypaste la urmatorul cod: https://pastebin.com/pfNEcACv Pasul 5 - In package-lock.json copypaste la urmatorul cod: https://pastebin.com/2dRvEwvt Pasul 6 - In package.json copypaste la urmatorul cod: https://pastebin.com/Fjg073BQ Pasul 7 - Dam run la repl-u' nostru, asteptam sa instaleze tot ce e de instalat si dupa ce termina copiam linku' de la repl-u' nostru (o sa avem nevoie de el mai tarziu): Pasul 8 - Mai facem un repl de nodejs si il numim "ChatRoom" (sau ce nume vrem). Pasul 9 - Pe langa index.js facem 2 fisiere numite: package-lock.json; package.json. Pasul 10 - In index.js copypaste la urmatorul cod: https://pastebin.com/a5j9MPNa Pe linia de cod 4 unde scrie: var socket = io("Link"); in loc de "link" punem link-u' de la repl-u' ce-l facusem inainte. (Repl-u' cu numele server sau ce nume a-ti pus). Pasul 11 - In package-lock.json copypaste la urmatorul cod: https://pastebin.com/sABUuGCB Pasul 12 - In package.json copypaste la urmatorul cod: https://pastebin.com/xtgv9pMr GATA DAM RUN SI DESCHIDEM LINK-U DE LA REPL-U' "CHATROOM" SAU CUM L-ATI NUMIT. SI IL DAM PERSOANEI CU CARE VREM SA COMUNICAM PE ACEL CHATROOM LINK DE LA CHATROOM-UL CE L-AM FACUT PENTRU ACEST TUTORIAL: https://chatroom.tutorialerepl.repl.run/ Ai explicat fain,Felicitari si bine ai venit.Incearca sa postezi ceva continut mai ok si nineni nu o sa mai zica nimic.BAFTA! 1 Quote Link to comment Share on other sites More sharing options...
ESCAPE98 Posted September 15, 2019 Author Report Share Posted September 15, 2019 9 minutes ago, mDOS said: Ai explicat fain,Felicitari si bine ai venit.Incearca sa postezi ceva continut mai ok si nineni nu o sa mai zica nimic.BAFTA! Mersi apreciez. Quote Link to comment Share on other sites More sharing options...