我有一个在nodejs上使用html-pdf
生成PDF的应用程序,但是在部署到生产服务器之后,我无法生成。它给出了这个错误:
'html-pdf:未能加载PhantomJS模块。必须使用“options.phantomPath”设置PhantomJS二进制文件的路径。
如果我再次运行npm install html-pdf
,就会出现以下错误
npm ERR! errno 1
npm ERR! node@11.8.0 preinstall: `node installArchSpecificPackage`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node@11.8.0 preinstall script.
这个错误复制到其他模块,但我做了一个转身。
运行节点13.7.0和npm 6.9.0
发布于 2020-02-18 20:09:35
你能用-g
标志再试一次吗
npm install -g html-pdf
如果仍然不能工作,请在此之后执行:
npm link html-pdf
npm link phantomjs-prebuilt
来自https://github.com/marcbachmann/node-html-pdf/issues/437#issuecomment-467463285
https://stackoverflow.com/questions/60288598
复制相似问题