0

While running phantomjs module in nodejs, I got this strange error

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. I tried rebuilding the phantomjs node module, reinstalling the latest phantomjs like this one, and still the error showed up. I tried building the phantomjs source, but apparently my machine didn't have enough virtual memory. :(

Community
  • 1
  • 1
Oscar Yuandinata
  • 1,025
  • 1
  • 13
  • 31

1 Answers1

0

It turns out that ubuntu download different files when I run npm install. So in my computer (OSX) it runs fine while on ubuntu, it crashes. To resolve it, I run npm remove then npm install again.

Oscar Yuandinata
  • 1,025
  • 1
  • 13
  • 31