electron / rebuild

Package to rebuild native Node.js modules against the currently installed Electron version
MIT License
1.02k stars 175 forks source link

Fatal error C1083: Cannot open include file: 'openssl/opensslv.h #175

Closed DutchKevv closed 7 years ago

DutchKevv commented 7 years ago

After updating to 1.5.11 windows give trouble about missing openSSL (probably when compiling sqllite3). When I downgrade 1.5.7 all works fine again.

I removed the node_modules foler and reinstalled everyting to give it a fresh shot, but didn't help.

Is it a hard dependency now to have openSSL installed on windows machines??

Thanks!

Here is the console log ->

[sqlite3] Success: "C:\Users\Kewin\Projects\TradeJS\server\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node" is installed via remote

tradejs@0.0.11 postinstall C:\Users\Kewin\Projects\TradeJS\server electron-rebuild -w sqlite3 -v 1.6.6 && node copy-sql3-binary.js --version=53

× Rebuild Failed An unhandled error occurred inside electron-rebuild Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Extensions.cpp Group.cpp Networking.cpp Hub.cpp Node.cpp WebSocket.cpp HTTPSocket.cpp Socket.cpp c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Group.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Hub.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Networking.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\WebSocket.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Socket.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Node.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\HTTPSocket.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] addon.cpp win_delay_load_hook.cc c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\addon.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.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\Kewin\Projects\TradeJS\server\node_modules\node-gyp\lib\build.js:285:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:194:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Windows_NT 10.0.15063 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Kewin\Projects\TradeJS\server\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=1.6.6" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" gyp ERR! cwd C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws gyp ERR! node -v v7.9.0 gyp ERR! node-gyp -v v3.6.1 gyp ERR! not ok

Failed with exit code: 1

Error: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Extensions.cpp Group.cpp Networking.cpp Hub.cpp Node.cpp WebSocket.cpp HTTPSocket.cpp Socket.cpp c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Group.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Hub.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Networking.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\WebSocket.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Socket.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\Node.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\HTTPSocket.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.vcxproj] addon.cpp win_delay_load_hook.cc c:\users\kewin\projects\tradejs\server\node_modules\uws\src\Networking.h(7): fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory (compiling source file ..\src\addon.cpp) [C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\build\uws.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\Kewin\Projects\TradeJS\server\node_modules\node-gyp\lib\build.js:285:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:194:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Windows_NT 10.0.15063 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Kewin\Projects\TradeJS\server\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=1.6.6" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" gyp ERR! cwd C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws gyp ERR! node -v v7.9.0 gyp ERR! node-gyp -v v3.6.1 gyp ERR! not ok

Failed with exit code: 1 at SafeSubscriber._error (C:\Users\Kewin\Projects\TradeJS\server\node_modules\spawn-rx\lib\src\index.js:262:84) at SafeSubscriber.tryOrUnsub (C:\Users\Kewin\Projects\TradeJS\server\node_modules\rxjs\Subscriber.js:238:16) at SafeSubscriber.error (C:\Users\Kewin\Projects\TradeJS\server\node_modules\rxjs\Subscriber.js:197:26) at Subscriber._error (C:\Users\Kewin\Projects\TradeJS\server\node_modules\rxjs\Subscriber.js:128:26) at Subscriber.error (C:\Users\Kewin\Projects\TradeJS\server\node_modules\rxjs\Subscriber.js:102:18) at MapSubscriber.Subscriber._error (C:\Users\Kewin\Projects\TradeJS\server\node_modules\rxjs\Subscriber.js:128:26) at MapSubscriber.Subscriber.error (C:\Users\Kewin\Projects\TradeJS\server\node_modules\rxjs\Subscriber.js:102:18) at SafeSubscriber._next (C:\Users\Kewin\Projects\TradeJS\server\node_modules\spawn-rx\lib\src\index.js:236:65) at SafeSubscriber.tryOrSetError (C:\Users\Kewin\Projects\TradeJS\server\node_modules\rxjs\Subscriber.js:247:16) at SafeSubscriber.next (C:\Users\Kewin\Projects\TradeJS\server\node_modules\rxjs\Subscriber.js:187:27)

MarshallOfSound commented 7 years ago

I don't see how the changeset could cause this error, the only thing that could potentially cause this is the bump in node-gyp dependency from ^3.4.0 to ^3.6.0 which should be the same thing really. 😕

https://github.com/electron/electron-rebuild/compare/v1.5.7...master?expand=1

Can you isolate the exact version it breaks, try 1.5.8,9,10 as well 👍

DutchKevv commented 7 years ago

Hi @MarshallOfSound thanks for the quick reply!

I'm looking at it right now, but also a quick update:

The same error happened to me about a week ago, then I did the same thing

But for some reason 1.5.7 now keeps giving me this same error, even I revert everything.. So I suspect something else is wrong at my end. Although it strange cause I worked an hour ago before I updated the packages... Maybe another package is doing wrong things.

Will keep you updated!!

MarshallOfSound commented 7 years ago

Sounds like an issue with another package but I'll leave it open for now 😄

DutchKevv commented 7 years ago

Haha guess so.. Sorry to bump you with it! Give me 24 hours to see whats going on (y)

DutchKevv commented 7 years ago

Hmm okay found the direction of the problem, but don't really understand whats going on underwater...

The problem is with the socket.io package... 1.7.3 worked fine, @latest (2.0.1) fails..

It starts with this error

An unhandled error occurred inside electron-rebuild ENOENT: no such file or directory, open 'C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\package.json'

Error: ENOENT: no such file or directory, open 'C:\Users\Kewin\Projects\TradeJS\server\node_modules\uws\package.json'

What is strange, because the uws folder gets created everytime I run npm i (think node-gyp creates it). But sometimes this folder is almost empty. When I remove the folder by hand and run npm i again.. Then the uws folder is created like normal module (with package.json etc) and then the error shows up given in the original comment.

So its related to socket.io module, but my knowledge (and time) are not big enough to dig very deep. Everything works fine with every electron-rebuild version, as long as I stay below socket.io < v2.

Thanks and sorry for the false alarm!

DutchKevv commented 7 years ago

Here is the full (none-working) package.json for later reference:

{
  "name": "tradejs",
  "version": "0.0.11",
  "description": "Javascript Trading Client",
  "email": "kewin@frontend-freelance.com",
  "author": "Kewin Brandsma",
  "private": false,
  "license": "Apache License 2.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/DutchKevv/TradeJS.git"
  },
  "keywords": [
    "TradeJS",
    "Stock",
    "Forex",
    "Trade",
    "Trading",
    "Node",
    "Trading",
    "NodeJS"
  ],
  "scripts": {
    "postinstall": "electron-rebuild -w sqlite3 -v 1.6.6 && node copy-sql3-binary.js --version=53",
    "start": "cross-env DEBUG=TradeJS:* gulp server:dev --web",
    "lint": "gulp tslint",
    "dist": "build",
    "build": "gulp server:build",
    "build:custom": "gulp custom:build",
    "prod": "cross-env NODE_ENV=production node dist/server/bin/www.js",
    "__temp-node-ipc": "git://github.com/RIAEvangelist/node-ipc.git#v9.x"
  },
  "dependencies": {
    "backbone-events-standalone": "0.2.7",
    "body-parser": "1.17.1",
    "cli-table": "0.3.1",
    "cors": "2.8.3",
    "cross-env": "^5.0.0",
    "debug": "^2.6.6",
    "deepmerge": "1.3.2",
    "directory-tree": "1.2.1",
    "electron-rebuild": "^1.5.11",
    "event-stream": "*",
    "express": "4.15.2",
    "freeport": "1.0.5",
    "gulp": "3.9.1",
    "gulp-sourcemaps": "2.6.0",
    "gulp-tslint": "8.0.0",
    "gulp-typescript": "3.1.6",
    "lodash": "4.17.4",
    "minimist": "1.2.0",
    "mkdirp": "0.5.1",
    "moment": "*",
    "node-ipc": "git://github.com/RIAEvangelist/node-ipc.git#v9.x",
    "node-watch": "^0.5.4",
    "nodemon": "1.11.0",
    "readable-timespan": "1.2.0",
    "request": "2.81.0",
    "rmdir": "1.2.0",
    "run-sequence": "1.2.2",
    "socket.io": "^2.0.1",
    "source-map-support": "0.4.14",
    "sqlite3": "^3.1.8",
    "sqlite3-transactions": "0.0.5",
    "tree-kill": "1.1.0",
    "tslint": "5.1.0",
    "typescript": "2.3.2",
    "watch": "1.0.2"
  },
  "devDependencies": {
    "@types/body-parser": "1.16.3",
    "@types/compression": "0.0.33",
    "@types/cors": "2.8.1",
    "@types/debug": "0.0.29",
    "@types/express": "4.0.35",
    "@types/freeport": "1.0.21",
    "@types/lodash": "4.14.62",
    "@types/minimist": "1.2.0",
    "@types/mkdirp": "0.3.29",
    "@types/moment": "2.13.0",
    "@types/node": "7.0.12",
    "@types/socket.io": "1.4.29",
    "@types/socket.io-client": "1.4.29",
    "@types/sqlite3": "2.2.33"
  }
}
arximboldi commented 6 years ago

@DutchKevv I am hitting this right now. Did you manage to fix this somehow? Reverting to socket.io 1.7 is not an option for me... :(