brianc / node-pg-native

Native (C/C++) bindings to PostgreSQL with sync and async options.
247 stars 44 forks source link

node won't run if pg-native is referenced #51

Open jayrosen1576 opened 7 years ago

jayrosen1576 commented 7 years ago

attempting to start a node.js app with 'pg-native' throws the following error:

o:\Projects\my-project\webapp\node_modules\bindings\bindings.js:83
        throw e
        ^

Error: The operating system cannot run %1.
\\?\o:\Projects\my-project\webapp\node_modules\libpq\build\Release\addon.no
de
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at bindings (o:\Projects\my-project\webapp\node_modules\bindings\bindin
gs.js:76:44)
    at Object.<anonymous> (o:\Projects\my-project\webapp\node_modules\libpq
\index.js:1:108)
    at Module._compile (module.js:570:32)

I am running Windows (unfortunately) and have C++ redistributable, postgres and node installed properly. I run the same code on my MAc and it's fine. Any ideas would be a huge help. If I remove var pgNative = require('pg-native'); the app starts up fine.

gdarcan commented 5 years ago

copy paste all .dll files in PostgreSQL's bin directory to C:\Windows

I copied below dll's and it worked, voila! libcurl.dll, libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq.dll, libxml2.dll, libxslt.dll, ssleay32.dll, zlib1.dll