node-pg-native icon indicating copy to clipboard operation
node-pg-native copied to clipboard

node won't run if pg-native is referenced

Open jayrosen1576 opened this issue 8 years ago • 1 comments

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.

jayrosen1576 avatar Feb 20 '17 20:02 jayrosen1576

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

gdarcan avatar Feb 11 '19 04:02 gdarcan