JoshKaufman / ursa

URSA - RSA public/private key OpenSSL bindings for Node.js
Other
619 stars 135 forks source link

Building on windows 10 fails due to OpenSSL #156

Open JoeyAcc opened 7 years ago

JoeyAcc commented 7 years ago

When I try to install a project dependency that uses this, I get an OpenSSL error. I'm using win10 and Node 4.5.0 (which is an actively supported LTS release).

joey@DESKTOP-P4V3PIP MINGW64 ~/WebstormProjects/sbr-viewer-ws (xbrlToJson_REST)
$ npm install ursa

> ursa@0.9.4 install C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa
> node-gyp rebuild

C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa>if not defined npm_config_node_gyp (node "C:\Users\Joey\AppData\Roaming\nvm\v4.5.0\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  ursaNative.cc
  win_delay_load_hook.cc
..\src\ursaNative.cc(157): warning C4244: 'argument': conversion from 'ssize_t' to 'int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(172): warning C4244: 'argument': conversion from 'ssize_t' to 'int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(378): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(379): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(686): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(734): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(779): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(826): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(945): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
..\src\ursaNative.cc(1003): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
LINK : fatal error LNK1181: cannot open input file 'C:\OpenSSL-Win64\lib\libeay32.lib' [C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa\build\ursaNative.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Joey\AppData\Roaming\nvm\v4.5.0\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Joey\\AppData\\Roaming\\nvm\\v4.5.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Joey\WebstormProjects\sbr-viewer-ws\node_modules\ursa
gyp ERR! node -v v4.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "ursa"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! ursa@0.9.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ursa@0.9.4 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the ursa package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ursa
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls ursa
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Joey\WebstormProjects\sbr-viewer-ws\npm-debug.log
liuyimx commented 7 years ago

me to

jaggr2 commented 6 years ago

I had this error too: "LINK : fatal error LNK1181: cannot open input file 'C:\OpenSSL-Win64\lib\libeay32.lib"

I've solved it by installing OpenSSL x64 v1.0.2o instead of the v1.1.0h. It seems that in the 1.1.x branch they have removed the \lib\libeay32.lib static build library file, even in the full version of the installer, but I haven't looked deeper into it.

Edit: Just saw this pull request which adds this information to the readme: https://github.com/JoshKaufman/ursa/pull/147