Open idsus opened 4 years ago
First install all the dependencies then run npm start
and open localhost on port 3030
So what is the command to install the dependencies? @AmeerHamoodi
npm i
or npm install
just run that and it will auto install all dependencies
After installing dependencies...type nodemon server.js
let me see
@starc007
@starc007 @AmeerHamoodi I got this error
C:\Users\susmitdas\Downloads\nodejs-zoom-clone-master\node_modules\uuid\dist\esm-browser\index.js:1 export { default as v1 } from './v1.js'; ^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:1060:16)
at Module._compile (internal/modules/cjs/loader.js:1108:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
at Module.load (internal/modules/cjs/loader.js:993:32)
at Function.Module._load (internal/modules/cjs/loader.js:892:14)
at Module.require (internal/modules/cjs/loader.js:1033:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.
In place of export there will be 'import'
On all the export statements? export { default as v1 } from './v1.js'; export { default as v3 } from './v3.js'; export { default as v4 } from './v4.js'; export { default as v5 } from './v5.js'; export { default as NIL } from './nil.js'; export { default as version } from './version.js'; export { default as validate } from './validate.js'; export { default as stringify } from './stringify.js'; export { default as parse } from './parse.js';
C:\Users\susmitdas\Downloads\nodejs-zoom-clone-master\node_modules\uuid\dist\esm-browser\index.js:1 import { default as v1 } from './v1.js'; ^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1060:16)
at Module._compile (internal/modules/cjs/loader.js:1108:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
at Module.load (internal/modules/cjs/loader.js:993:32)
at Function.Module._load (internal/modules/cjs/loader.js:892:14)
at Module.require (internal/modules/cjs/loader.js:1033:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.
@starc007
Did you installed the dependencies by running npm install ?
If the method of running via nodemon is not working do npm start
it worked for me when I was working on it locally @idontcareofusername
npm install
didn't work for me so I had to npm update
SyntaxError: Cannot use import statement outside a module
This error is probably because Node doesn't support import/export. You're going to need Babel to transcribe your ES6 to ES5 so node can run it. More information is found here: https://stackoverflow.com/questions/39005332/include-es6-class-from-external-file-in-node-js
The explanation & link above is for reference purposes -- don't worry about the error you're getting. You shouldn't have to change anything if you install the dependencies properly. Just npm update
and the app should work.
Don't change the export/import statements as mentioned in the comments above(unless they're the one who contributed to this app, in that case I could be wrong.) The app runs for me without any modification besides installing the dependencies.
error:
`C:\Users\susmitdas\Downloads\nodejs-zoom-clone-master\node_modules\uuid\dist\esm-browser\index.js:1 export { default as v1 } from './v1.js'; ^^^^^^
SyntaxError: Unexpected token 'export'`
Code Server.js
const express = require('express') const app = express() // const cors = require('cors') // app.use(cors()) const server = require('http').Server(app) const io = require('socket.io')(server) const { ExpressPeerServer } = require('peer'); const peerServer = ExpressPeerServer(server, { debug: true }); const { v4: uuidV4 } = require('uuid') app.use('/peerjs', peerServer); app.set('view engine', 'ejs') app.use(express.static('public')) app.get('/', (req, res) => { res.redirect(
/${uuidV4()}) }) app.get('/:room', (req, res) => { res.render('room', { roomId: req.params.room }) }) io.on('connection', socket => { socket.on('join-room', (roomId, userId) => { socket.join(roomId) socket.to(roomId).broadcast.emit('user-connected', userId); // messages socket.on('message', (message) => { //send message to the same room io.to(roomId).emit('createMessage', message) }); socket.on('disconnect', () => { socket.to(roomId).broadcast.emit('user-disconnected', userId) }) }) }) server.listen(process.env.PORT||3030)
Code Index.js
export { default as v1 } from './v1.js'; export { default as v3 } from './v3.js'; export { default as v4 } from './v4.js'; export { default as v5 } from './v5.js'; export { default as NIL } from './nil.js'; export { default as version } from './version.js'; export { default as validate } from './validate.js'; export { default as stringify } from './stringify.js'; export { default as parse } from './parse.js';
@rrafay @starc007 @AmeerHamoodi
What version of Node are you using @idontcareofusername ? Try updating node.
I updated but still error popped
https://github.com/starc007/Zoom-Clone Try this...Code
excatly same error popped up 😓
What version of node are you on, not sure it would have an effect on your current issue but it may. Also, try cloning the repository in a new folder then running npm i
then just doing npm start
and let us know what happens
not working
I'm starting from scratch now and same error pops up after downloading a package that handles uuidv4
Yo l might know your problem! did you install react???(in the first place) if not tell me and l will give you the code to do it!
What do you mean by installing react?
You need to install react on your pc for the whole thing to work silly.
1.Download the file 2.use npm install -g create-react-app in visual studio code 3.use npm i 4.use nodemon server.js 5.open port 3030 or l think its 3000 at localhost
npm i or npm install takes a long time to install just saying
a reply plz?
Ok let me try that. I think it might work!
Ayyy l hope it does!!
What are the commands to run for it to work/ run.