Easyrtc gives socket.io.js file issue for the html of the site - node.js

The same question is available on easyrtc forum
https://easyrtc.com/forums/viewthread/167/
I was trying to implement the demo provided here : https://demo.easyrtc.com/demos/demo_audio_video_simple.html
Following steps as given in the below link
https://easyrtc.com/docs/guides/easyrtc_server_install.php
—-
Install Node.js
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
—-
I am at logged in as root user
root#pbx:/var/www/html#
I did not get any erorr while running above commands
After running the above commands , I went to the second step
——-
2. Create folder hold the EasyRTC application
ex: sudo mkdir /var/nodes
ex: sudo mkdir /var/nodes/easyrtc
—-
I created a folder /var/nodes/easyrtc as given in example
Should I create instead on /var/www/html (where my domain is pointed to)
—-
3. Security Considerations (not going into specifics)
Create user for node.js (or use existing web user)
chown the nodes folder to be owned by this user
ensure the node is run as that user.
—-
Skipping above step since I am already logged in as root.
Please point out how I could verify the three things mentioned above.
———
Download files from the server_example(https://github.com/priologic/easyrtc/tree/master/server_example) folder into your EasyRTC application folder.
OR download and extract this .zip
—-
Does ‘EasyRTC application folder’ mentioned above indicate /var/nodes/easyrtc ?
https://github.com/priologic/easyrtc/tree/master/server_example
root#PBXRecptionist2:/var/nodes/easyrtc# ls
easyrtc-master master.zip package.json README.md server.js static
After downloading the files I get the above in the easyrtc folder
—
Change to the easyrtc folder and then install node modules locally
cd /var/nodes/easyrtc
sudo npm install
—
following the other instructuion
It added node_modules folder with modules as given below
root#PBXRecptionist2:/var/nodes/easyrtc/node_modules# ls
easyrtc express socket.io
—-
Running EasyRTC Server
From Console
Open your console on the server.
In Windows you can use the provided Node.js console program located in the Start Menu.
Navigate to your EasyRTC application folder
Run the server using the node command.
node server.js
—
What does “Open your console on the server.
” mean?
I am logged in via ssh
should I type command “node ” which opens a node console ??
Does “Navigate to your EasyRTC application folder” this mean moving to /var/nodes/easyrtc ?
When I do this “Run the server using the node command.” ,
node.js on /var/nodes/easyrtc
I get the following error
root#PBXRecptionist2:/var/nodes/easyrtc# node server.js
module.js:340
throw err;
^
Error: Cannot find module ‘../’
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. (/var/nodes/easyrtc/server.js:5:15)
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)
and if I do it
root#PBXRecptionist2:/var/nodes/easyrtc# node
node server.js
...
I dont get anything
can anybody point where I am going wrong
Also I get an error that” Your HTML has not included the socket.io.js library”
I am unsure how can I locate the socket.io.js library
My index.html for which I get the above error is
ABCTELECOMMUNICATION: Simple Audio and Video Chat
[removed][removed]
[removed][removed]
[removed][removed]
Not yet connected…
Connected users:
<div id=“otherClients”></div>
</div>
<div id=“videos”>
<video autoplay=“autoplay” class=“easyrtcMirror” id=“selfVideo” muted=“muted” volume=“0” ></video>
<div >
<video autoplay=“autoplay” id=“callerVideo”></video>
</div>
<!—each caller video needs to be in it"s own div so it"s close button can be positioned correctly—>
</div>
</div>
files in the same directory as on the index.html are
drwxr-xr-x 7 root root 4.0K Mar 22 09:14 node_modules
-rw-r—r—1 root root 603 Mar 22 09:08 server.js
-rw-r—r—1 root root 1.2K Mar 22 08:49 index.html
drwxr-xr-x 2 root root 4.0K Mar 22 08:44 easyrtc
-rw-r—r—1 root root 1.2K Mar 21 15:23 index.html~
-rw-r—r—1 root root 170 Mar 20 12:02 socket.io.zip
-rw-r—r—1 root root 1.4K Mar 17 09:50 server.crt
-rw-r—r—1 root root 1.2K Mar 17 09:47 server.csr
-rw-r—r—1 root root 1.7K Mar 17 09:31 server.key
-rw-r—r—1 root root 1.8K Mar 17 09:30 server.key.secure
drwxr-xr-x 2 root root 4.0K Feb 21 10:15 js
drwxr-xr-x 2 root root 4.0K Feb 21 10:00 easyrtc-master
-rw-r—r—1 root root 695K Feb 21 10:00 master.zip
drwxr-xr-x 3 root root 4.0K Aug 24 2015 api
drwxr-xr-x 5 root root 4.0K Aug 24 2015 demos
drwxr-xr-x 3 root root 4.0K Aug 24 2015 dev
drwxr-xr-x 4 root root 4.0K Aug 24 2015 docs
-rw-r—r—1 root root 100 Aug 24 2015 index.js
drwxr-xr-x 2 root root 4.0K Aug 24 2015 lib
-rw-r—r—1 root root 1.4K Aug 24 2015 LICENSE
-rw-r—r—1 root root 932 Aug 24 2015 package.json
-rw-r—r—1 root root 5.7K Aug 24 2015 README.md
drwxr-xr-x 3 root root 4.0K Aug 24 2015 server_example
Can someone help me debug and make the easyrtc work?

Related

kubernetes giving error,but code works

every time when deploying this images getting this error`
module.js:540
throw err;
^
Error: Cannot find module '/app/index.js'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
but code works on pc,I hadn't get error for other deployments they was done this way
dockerfile`
FROM node:8.9
ENV port 3000
WORKDIR /app
COPY package.json /app
RUN npm install
COPY . /app
CMD ["sh", "-c", "node index.js --port=${port}"]
yaml `
output of RUN ls -la after COPY ./app
Step 7/8 : RUN ls -la
---> Running in 9e24667abd49
total 76
drwxr-xr-x 9 root root 4096 Jun 21 07:14 .
drwxr-xr-x 57 root root 4096 Jun 21 07:14 ..
-rw-rw-r-- 1 root root 30 May 31 09:00 .dockerignore
-rw-rw-r-- 1 root root 151 Jun 21 07:14 Dockerfile
-rw-rw-r-- 1 root root 556 Jun 20 15:16 api.yaml
drwxrwxr-x 2 root root 4096 May 23 09:03 controllers
-rw-rw-r-- 1 root root 446 Jun 20 15:18 index.js
drwxrwxr-x 3 root root 4096 May 15 11:27 insert
drwxrwxr-x 3 root root 4096 May 15 11:27 modules
drwxr-xr-x 69 root root 4096 Jun 20 15:07 node_modules
-rw-r--r-- 1 root root 20404 Jun 20 15:07 package-lock.json
-rw-rw-r-- 1 root root 328 May 31 09:02 package.json
drwxrwxr-x 2 root root 4096 May 15 11:27 services
drwxrwxr-x 2 root root 4096 Jun 14 14:56 settings
drwxrwxr-x 2 root root 4096 May 23 09:35 utilities
just forget this!!I've tagged the same container as new version,pushed and its works!
Answered by Grigor:
I've tagged the same container as new version,pushed and its works!

webpack unable to resolve node module in docker image

#Dockerfile
FROM node:alpine
RUN mkdir /morty
ADD . /morty/
WORKDIR /morty/
RUN yarn cache clean && yarn install
RUN ls node_modules | grep autosuggest
RUN find /morty/node_modules/react-autosuggest -ls
CMD npm run dev
This builds as expected, but as soon as I request a page from the dev server, I get an error
ERROR in ./src/components/molecules/AutoSuggest/index.js
web_1 | Module not found: Error: Can't resolve 'react-autosuggest' in '/morty/src/components/molecules/AutoSuggest'
web_1 | #
which would suggest to me that for some reason, the react-autosuggest module was not installed; however, the output of step 6 & 7 in my Dockerfile seems to invalidate that hypothesis.
Step 6/7 : RUN ls node_modules | grep autosuggest
---> Running in 0c87c4318a6f
react-autosuggest
Step 7/9 : RUN find /morty/node_modules/react-autosuggest -ls
---> Running in 498c6b9080c7
12042711 4 drwxr-xr-x 3 root root 4096 Mar 6 16:40 /morty/node_modules/react-autosuggest
12042729 4 drwxr-xr-x 3 root root 4096 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist
521128 4 -rw-r--r-- 1 root root 1735 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/theme.js
12042731 4 drwxr-xr-x 2 root root 4096 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/standalone
521127 36 -rw-r--r-- 1 root root 33193 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/standalone/autosuggest.min.js
521126 112 -rw-r--r-- 1 root root 113248 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/standalone/autosuggest.js
521123 28 -rw-r--r-- 1 root root 27217 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/Autosuggest.js
521124 4 -rw-r--r-- 1 root root 65 Mar 6 16:40 /morty/node_modules/react-autosuggest/dist/index.js
521121 24 -rw-r--r-- 1 root root 24423 Mar 6 16:40 /morty/node_modules/react-autosuggest/README.md
521129 8 -rw-r--r-- 1 root root 4195 Mar 6 16:40 /morty/node_modules/react-autosuggest/package.json
521120 4 -rw-r--r-- 1 root root 1088 Mar 6 16:40 /morty/node_modules/react-autosuggest/LICENSE
package.json does contain the entry "react-autosuggest": "^9.3.4", in dependencies and the app performs as expected in its un-containerized form.
also, possibly relevant is that the base config for this project came from
the Arc project
I also faced this issue while trying to build my npm project using a container which had WORKDIR as a mounted volume. I resolved this issue by removing the mounted volume by name.
docker volume ls to list the volumes
DRIVER VOLUME NAME
local myproject_named_volume
docker volume rm -f myproject_named_volume to remove the volume
Hope this helps.

node.js cannot find app.js after deployment to elastic beanstalk

I've just deployed my application to elastic beanstalk by doing an eb push.
My application isn't starting and the node.js logs say the following:
Error: Cannot find module '/var/app/current/dist/app.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
There is definitely an app.js there as evidenced in my putty session
[ec2-user#ip-172-31-12-80 dist]$ pwd
/var/app/current/dist
[ec2-user#ip-172-31-12-80 dist]$ ls -l
total 20
-rw-r--r-- 1 nodejs nodejs 3298 Apr 14 11:43 app.js
drwxr-xr-x 27 nodejs nodejs 4096 Apr 14 11:43 node_modules
-rw-r--r-- 1 nodejs nodejs 858 Apr 14 11:43 package.json
drwxr-xr-x 3 nodejs nodejs 4096 Apr 14 11:43 public
drwxr-xr-x 2 nodejs nodejs 4096 Apr 14 11:43 routes
Anyone know what could be going wrong?
Thanks in advance,
Chris

CentOS and fontconfig: Cannot load default config file

I'm getting following error when using imagick:
Fontconfig error: Cannot load default config file
My script is working but i would like to fix this (is filling up log file).
OS is:
# cat /etc/redhat-release
CentOS release 5.10 (Final)
I was looking trough internet little bit and this is causing problem:
access("/etc/fonts/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
Folder exists:
# ls /etc/fonts/ -all
total 64
drwxr-xr-x 4 root root 4096 Jul 9 2010 ./
drwxr-xr-x 86 root root 12288 Jan 13 00:48 ../
drwxr-xr-x 2 root root 4096 Jan 3 2012 conf.avail/
drwxr-xr-x 2 root root 4096 Apr 14 2013 conf.d/
-rw-r--r-- 1 root root 5239 Jan 12 2008 fonts.conf
-rw-r--r-- 1 root root 6907 Jan 12 2008 fonts.dtd
But i see only this folder via root account, other account under with script is run doesn't see this folder. Permissions looks fine for me, but not so experienced with linux.
Account under with script is run is created with WHM.
Please help :)
I manage to solve my problem. chroot was making trouble.
I need to:
log with root account
find jailed environment of account on with i run script (in my case /home/virtfs/[username])
to create folder where i will mount real stuff mkdir /home/virtfs/[username]/etc/fonts
to mount /etc/fonts to this folder: mount --bind /etc/fonts /home/virtfs/[username]/etc/fonts
Posting an answer for CentOS 7 in 2021:
yum install fontconfig
More info here:
https://centos.pkgs.org/7/centos-x86_64/fontconfig-2.13.0-4.3.el7.x86_64.rpm.html

svn permission issue - txn-current-lock: Permission denied

I setup svn on my local system /svn/repos/myproject by following this tutorial. I'm able to view the repo in browser.
But when it try to import new project I couldn't through svn client ( rapid svn ) it shows following error:
Execute: Import
Error while performing action:
Can't open file '/svn/repos/myproject/db/txn-current-lock': Permission denied
Svn directory permissions:
→ ls -l /svn
total 12
drwxrwxr-x 2 root root 4096 Feb 15 12:09 permissions
drwxrwxr-x 4 apache apache 4096 Feb 15 12:09 repos
drwxrwxr-x 2 root root 4096 Feb 15 12:09 users
Repo directory:
→ ls -l
total 8
drwxrwxr-x 3 root root 4096 Feb 15 12:09 conf
drwxrwxr-x 7 apache apache 4096 Feb 15 12:09 myproject
How to solve this issue?
I've given 777 permission to repos directory which solved this issue. But i got another issue like Couldn't perform atomic initialization.
I think this is due to incompatible sqlite version with subversion we're using, this can be solved by updating svnadmin command,
svnadmin create --pre-1.6-compatible --fs-type fsfs /svn/repos/myproject

Resources