【问题标题】:PhantomJS errorPhantomJS 错误
【发布时间】:2017-06-28 02:15:12
【问题描述】:

error: Could not spawn [/root/AgarioBotsV3/node_modules/phantomjsprebuilt/lib/phantom\bin\phantomjs.exe ] executable. Please make sure phantomjs is installed correctly. error: Error: spawn /root/AgarioBotsV3/node_modules/phantomjs- prebuilt/lib/phantom\bin\phantomjs.exe ENOENT at exports._errnoException (util.js:1016:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19) at onErrorNT (internal/child_process.js:366:16) at _combinedTickCallback (internal/process/next_tick.js:102:11) at process._tickCallback (internal/process/next_tick.js:161:9) at Function.Module.runMain (module.js:607:11) at startup (bootstrap_node.js:158:16) at bootstrap_node.js:575:3 我不知道如何解决请帮忙。我使用的是 linux ubuntu 16.04 服务器

【问题讨论】:

  • Please make sure phantomjs is installed correctly. 如果没有安装,运行npm install -g phantomjs-prebuilt
  • 谢谢克里斯林。它奏效了。

标签: node.js phantomjs


【解决方案1】:

Please make sure phantomjs is installed correctly.

如果你没有安装它,运行npm install -g phantomjs-prebuilt

【讨论】:

    【解决方案2】:

    确保你有一个 .dockerignore 文件.. 在这行里面 节点模块

    【讨论】:

      【解决方案3】:

      我在 2021 年 3 月遇到了这个问题,并且在 dockerizing highcharts 时遇到了同样的问题:它在我的机器上工作,但在 docker run 上失败了。最后,解决方案是找到一个可行的 FROM 节点版本。这个 Dockerfile 使用最新的 Node docker 镜像和几乎最新的 highcharts npm 版本(总是选择特定的 npm 版本):

      FROM node:15.12.0
      
      ENV ACCEPT_HIGHCHARTS_LICENSE YES
      
      # see available versions of highcharts at https://www.npmjs.com/package/highcharts-export-server
      RUN npm install highcharts-export-server@2.0.30 -g
      
      EXPOSE 7801
      
      # run the container using: docker run -p 7801:7801 -t CONTAINER_TAG
      CMD [ "highcharts-export-server", "--enableServer", "1" ]
      

      【讨论】:

        猜你喜欢
        • 2018-02-23
        • 1970-01-01
        • 2018-02-13
        • 2015-09-28
        • 1970-01-01
        • 1970-01-01
        • 2015-07-04
        • 2015-02-22
        • 1970-01-01
        相关资源
        最近更新 更多