Google AppRTC Web Server

Google AppRTC Web Server

本文关键字:Server Web AppRTC Google      更新时间:2023-09-26

我做了什么:

  1. 我已经从链接下载了适用于ios的AppRTC演示 https://github.com/ISBX/apprtc-ios并从链接
    下载网络服务器https://github.com/ISBX/apprtc-server
  2. 我尝试将网络服务器安装到我的ubntu 14.04中:

    我按照以下步骤进行安装

    1.打开终端

    2.打开特定目录

    3.在终端中键入命令 npm install

    4.在安装过程中显示错误

错误:

 npm ERR! Linux 4.2.0-35-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.10.44
npm ERR! npm  v2.15.0
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package grunt@1.0.1 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer grunt-jinja@0.3.0 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-shell@1.3.0 wants grunt@>=0.4.0
npm ERR! peerinvalid Peer grunt-contrib-compress@0.13.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-contrib-jshint@0.10.0 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-htmlhint@0.9.12 wants grunt@~0.4.1
npm ERR! peerinvalid Peer grunt-closurecompiler@0.9.9 wants grunt@~0.4.0
npm ERR! peerinvalid Peer grunt-jstestdriver-phantomjs@0.0.7 wants grunt@~0.4.0
npm ERR! Please include the following file with any support request:
npm ERR!    /home/Downloads/apprtc-server-master/npm-debug.log

我必须做什么才能解决这个问题?

将 package.json 修改为:

...
"devDependencies": {
     "grunt": ">=0.4.5 <1.0.0",
     ...
 }

可以解决此问题。

npm 作为 nodejs 的一部分分发。

sudo apt-get install nodejs
sudo npm install -g npm

在 Ubuntu 14.04 上,默认软件包安装/usr/bin/nodejs,但 grunt 需要/usr/bin/node 可执行文件。它安装在一些 Ubuntu 软件包集上;如果缺少它,您可以通过安装 nodejs-legacy 包来添加它,

sudo apt-get install nodejs-legacy

最简单的方法是使用 -g 标志从 npm 安装共享版本的 grunt-cli。这将允许你从/usr/local/bin 访问 grunt 命令。更多信息可以在gruntjs Getting Start上找到。

sudo npm -g install grunt-cli

省略 -g 标志会将 grunt-cli 安装到 node_modules 目录下的当前目录。

设置环境只需要满足以下条件:

git clone https://github.com/ISBX/apprtc-node-server.git ./apprtc-node-server
cd ./apprtc-node-server
 sudo npm install

运行应用RTC节点服务器

apprtc-node-server 使用 ExpressJS。要在设置后运行节点服务器,只需执行:

node ./bin/www

导航到 http://localhost:3000 以运行WebRTC演示