幽灵JS错误

5

错误:无法生成[ /root/AgarioBotsV3/node_modules/phantomjsprebuilt/lib/phantom\bin\phantomjs.exe ]可执行文件。请确保正确安装了phantomjs。 错误:Error: spawn/root/AgarioBotsV3/node_modules/phantomjs-prebuilt/lib/phantom\bin\phantomjs.exe ENOENT 在exports._errnoException(util.js:1016:11) 中进程. ChildProcess._handle.onexit(internal/child_process.js: 189:19) onErrorNT(internal/child_process.js:366:16) 合并的_tickCallback(internal/process/next_tick.js:102:11) process._tickCallback(internal/process/next_tick.js:161:9) Function.Module.runMain(module.js:607:11) startup(bootstrap_node.js:158:16) bootstrap_node.js:575:3 我不知道如何修复,请帮忙。 我正在使用Linux Ubuntu 16.04服务器。


1
Please make sure phantomjs is installed correctly. If you don't have it installed, run npm install -g phantomjs-prebuilt - Chris Lam
谢谢Chris Lam。它起作用了。 - Sh0T
3个回答

6
请确保phantomjs已正确安装。 如果您未安装,运行npm install -g phantomjs-prebuilt。

1

请确保您有一个名为 .dockerignore 的文件。在其中添加一行 node_modules。


0
我在2021年3月遇到了这个问题,即将highcharts docker化时出现了相同的问题:它在我的机器上运行正常,但在docker运行时失败。最终的解决方案是找到一个适用的FROM node版本。这个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" ]

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接