简体   繁体   English

在Ubuntu 14.04中运行phantomjs的未知错误

[英]Unknown error running phantomjs in Ubuntu 14.04

While running phantomjs module in nodejs, I got this strange error 在nodejs中运行phantomjs模块时,出现了这个奇怪的错误

phantom stderr: Fontconfig warning: ignoring UTF-8: not a valid region tag


/var/www/myWeb/Web/Front/node_modules/phantom/node_modules/dnode/node_modules/weak/node_modules/bindings/bindings.js:83
        throw e
              ^
Error: /var/www/myWeb/Web/Front/node_modules/phantom/node_modules/dnode/node_modules/weak/build/Release/weakref.node: invalid ELF header
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at bindings (/var/www/myWeb/Web/Front/node_modules/phantom/node_modules/dnode/node_modules/weak/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/var/www/myWeb/Web/Front/node_modules/phantom/node_modules/dnode/node_modules/weak/lib/weak.js:7:35)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

Can anyone tell me how to solve it? 谁能告诉我如何解决? It always causes the nodejs app to crash. 它总是导致nodejs应用崩溃。 I tried rebuilding the phantomjs node module, reinstalling the latest phantomjs like this one , and still the error showed up. 我尝试重建phantomjs节点模块,重新安装最新的phantomjs, 就像这样 ,仍然显示错误。 I tried building the phantomjs source, but apparently my machine didn't have enough virtual memory. 我尝试构建phantomjs源,但是显然我的机器没有足够的虚拟内存。 :( :(

It turns out that ubuntu download different files when I run npm install . 原来,当我运行npm install时,ubuntu下载了不同的文件。 So in my computer (OSX) it runs fine while on ubuntu, it crashes. 因此,在我的计算机(OSX)上,在ubuntu上运行正常,它崩溃了。 To resolve it, I run npm remove then npm install again. 要解决此问题,我运行npm remove然后再次运行npm install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM