我试图在服务器上运行Nightmare.js。我很清楚它在Linux上是无头的,并且需要xvfb
。我不明白的是为什么我继续得到以下错误在调试模式:Nightmare.js与Docker
nightmare queuing process start +0ms
nightmare queueing action "useragent" +3ms
nightmare queueing action "goto" for https://news.ycombinator.com +2ms
nightmare queueing action "cookies" +1ms
nightmare queueing action "goto" for https://news.ycombinator.com/login +0ms
nightmare queueing action "type" +1ms
nightmare queueing action "type" +0ms
nightmare queueing action "click" +0ms
nightmare queueing action "wait" +1ms
nightmare queueing action "goto" for https://news.ycombinator.com/item?id=11878025 +0ms
nightmare queueing action "click" +0ms
nightmare queueing action "wait" +1ms
nightmare running +0ms
nightmare electron child process exited with code 2: undefined +25ms
这里是我的Dockerfile:
FROM node:latest
RUN apt-get update &&\
apt-get install -y \
xvfb \
x11-xkb-utils \
xfonts-100dpi \
xfonts-75dpi \
xfonts-scalable \
xfonts-cyrillic \
x11-apps \
clang \
libdbus-1-dev \
libgtk2.0-dev \
libnotify-dev \
libgnome-keyring-dev \
libgconf2-dev \
libasound2-dev \
libcap-dev \
libcups2-dev \
libxtst-dev \
libxss1 \
libnss3-dev \
gcc-multilib \
g++-multilib
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm install
CMD DEBUG=nightmare* xvfb-run --server-args="-screen 0 1024x768x24" node tux.js -s hn -m create -p 11878025
有什么想法?帮助将不胜感激。
你使用的是什么版本的梦魇? – Ross
你可以用DEBUG =噩梦运行它:*,electron:*,看看你是否得到了一些有用的日志消息? – khattam
运行最新版本的nightmare.js(2.5.1),我在上面的帖子中获得了以下输出。 –