node.js - kurento - docker 的 npm 安装错误

标签 node.js linux docker npm-install kurento

我正在尝试在 Docker 容器中安装 kurento 媒体服务器和一个教程。

Kurento 媒体服务器安装指南:

http://doc-kurento.readthedocs.io/en/stable/installation_guide.html

Kurento 教程安装:(使用 node.js):

http://doc-kurento.readthedocs.io/en/stable/tutorials/node/tutorial-one2one.html

首先我尝试在 ubuntu 机器上安装相同的程序,手动执行每个命令以便我可以看到它工作正常。

但是当我尝试在 docker 容器中安装相同的内容时,它无法正常工作。

Dockerfile如下:

FROM ubuntu:14.04
MAINTAINER USER1 "USER1@infinte.com"
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q python-software-properties software-properties-common
RUN apt-get install wget -y
RUN apt-get install git -y
RUN apt-get install curl -y
RUN echo "deb http://ubuntu.kurento.org trusty kms6" | sudo tee /etc/apt/sources.list.d/kurento.list
RUN wget -O - http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -
RUN apt-get update -y
RUN apt-get install kurento-media-server-6.0 -y
RUN sudo service kurento-media-server-6.0 start
RUN sudo service kurento-media-server-6.0 stop
RUN curl -sL https://deb.nodesource.com/setup | sudo bash -
RUN sudo apt-get install -y nodejs -y
RUN sudo npm install -g bower -y
RUN git clone https://github.com/Kurento/kurento-tutorial-node.git
RUN cd kurento-tutorial-node/kurento-one2one-call && pwd
RUN cd kurento-tutorial-node/kurento-one2one-call && git checkout 6.1.0
RUN sudo service kurento-media-server-6.0 start
RUN sudo apt-get install build-essential -y
RUN apt-get install python2.7-dev -y
RUN apt-get update -y
RUN cd kurento-tutorial-node/kurento-one2one-call && sudo npm install
EXPOSE 8443

我收到如下错误:

npm install 命令期间发生错误。

Step 25 : RUN cd kurento-tutorial-node/kurento-one2one-call && npm install
 ---> Running in d8c66e73f94f

> utf-8-validate@1.1.0 install /kurento-tutorial-node/kurento-one2one-call/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

make: Entering directory `/kurento-tutorial-node/kurento-one2one-call/node_modules/ws/node_modules/utf-8-validate/build'
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory `/kurento-tutorial-node/kurento-one2one-call/node_modules/ws/node_modules/utf-8-validate/build'
npm WARN cannot run in wd ws@0.4.32 (node-gyp rebuild 2> builderror.log) || (exit 0) (wd=/kurento-tutorial-node/kurento-one2one-call/node_modules/kurento-client/node_modules/reconnect-ws/node_modules/websocket-stream/node_modules/ws)

> bufferutil@1.1.0 install /kurento-tutorial-node/kurento-one2one-call/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

make: Entering directory `/kurento-tutorial-node/kurento-one2one-call/node_modules/ws/node_modules/bufferutil/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
make: Leaving directory `/kurento-tutorial-node/kurento-one2one-call/node_modules/ws/node_modules/bufferutil/build'

> ws@0.4.32 install /kurento-tutorial-node/kurento-one2one-call/node_modules/kurento-client/node_modules/kurento-jsonrpc/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/kurento-tutorial-node/kurento-one2one-call/node_modules/kurento-client/node_modules/kurento-jsonrpc/node_modules/ws/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory `/kurento-tutorial-node/kurento-one2one-call/node_modules/kurento-client/node_modules/kurento-jsonrpc/node_modules/ws/build'
npm WARN cannot run in wd kurento-one2one-call@6.1.0 cd static && bower install (wd=/kurento-tutorial-node/kurento-one2one-call)
minimist@1.2.0 node_modules/minimist

似乎错误出在 node.js 部分,有人帮我解决了这个问题。

最佳答案

我可以忽略之前收到的错误。

需要更改npm install命令如下:

npm install --unsafe-perm

这样我就可以克服错误。

关于node.js - kurento - docker 的 npm 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38815410/

相关文章:

c# - mono c# strange Address already in use 错误

linux - '.save_docker/' 文件夹是什么?我可以删除它吗?

docker - 基于Linux的Docker但在内部运行Windows

javascript - NodeJS : Chain functions automatically in a promise?

mongodb - 查询 MongoDB GridFS?

mysql - 无法使用Nodejs连接Azure Mysql

linux - How to compile c sharp console application in linux with multiple modules (how to define order of fs files?)

linux - 在VMware机器上抓包

Docker 窗口端口不可用 :

javascript - Node.js - 使用 async.waterfall 进行依赖 API 请求调用,并使用 underscore.extend 合并 JSON 响应