An unhandled error occurred inside electron-rebuild
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 181
- Avg merge
- 6h 44m
- Merged PRs (30d)
- 3
Description
I am new to NodeJs, I'm working with an Electron app I want to connect my app with SqLite, I have already Installed:
- sqlite3
- Electron & Electron rebuild
- Python and VS desktop development tools
_But I'm still can't run my program due to following errors:_
```
E:\electron\hy>npm run rebuild
> hy@1.0.0 rebuild E:\electron\hy
> electron-rebuild -f -w sqlite3
× 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.
unpack_sqlite_dep
'C:\Users\C' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): error MSB6006: "cmd.exe" exited with code 1. [E:\electron\hy\node_modules\sqlite3\build\deps\action_before_build.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (E:\electron\hy\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:310:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\electron\\hy\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=8.2.2" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source" "--module_name=node_sqlite3" "--module_path=E:\\electron\\hy\\node_modules\\sqlite3\\lib\\binding\\electron-v8.2-win32-x64" "--host=https://mapbox-node-binary.s3.amazonaws.com" "--remote_path=./{name}/v4.1.1/{toolset}/" "--package_name=electron-v8.2-win32-x64.tar.gz"
gyp ERR! cwd E:\electron\hy\node_modules\sqlite3
gyp ERR! node -v v12.16.2
gyp ERR! node-gyp -v v6.1.0
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.
unpack_sqlite_dep
'C:\Users\C' is not recognized as an internal or external command,
operable program or batch file.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): error MSB6006: "cmd.exe" exited with code 1. [E:\electron\hy\node_modules\sqlite3\build\deps\action_before_build.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (E:\electron\hy\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:310:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\electron\\hy\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=8.2.2" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source" "--module_name=node_sqlite3" "--module_path=E:\\electron\\hy\\node_modules\\sqlite3\\lib\\binding\\electron-v8.2-win32-x64" "--host=https://mapbox-node-binary.s3.amazonaws.com" "--remote_path=./{name}/v4.1.1/{toolset}/" "--package_name=electron-v8.2-win32-x64.tar.gz"
gyp ERR! cwd E:\electron\hy\node_modules\sqlite3
gyp ERR! node -v v12.16.2
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
Failed with exit code: 1
at SafeSubscriber._error (E:\electron\hy\node_modules\spawn-rx\lib\src\index.js:267:84)
at SafeSubscriber.__tryOrUnsub (E:\electron\hy\node_modules\rxjs\internal\Subscriber.js:205:16)
at SafeSubscriber.error (E:\electron\hy\node_modules\rxjs\internal\Subscriber.js:156:26)
at Subscriber._error (E:\electron\hy\node_modules\rxjs\internal\Subscriber.js:92:26)
at Subscriber.error (E:\electron\hy\node_modules\rxjs\internal\Subscriber.js:72:18)
at MapSubscriber.Subscriber._error (E:\electron\hy\node_modules\rxjs\internal\Subscriber.js:92:26)
at MapSubscriber.Subscriber.error (E:\electron\hy\node_modules\rxjs\internal\Subscriber.js:72:18)
at SafeSubscriber._next (E:\electron\hy\node_modules\spawn-rx\lib\src\index.js:242:65)
at SafeSubscriber.__tryOrUnsub (E:\electron\hy\node_modules\rxjs\internal\Subscriber.js:205:16)
at SafeSubscriber.next (E:\electron\hy\node_modules\rxjs\internal\Subscriber.js:143:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! hy@1.0.0 rebuild: `electron-rebuild -f -w sqlite3`
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the hy@1.0.0 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jawad\AppData\Roaming\npm-cache\_logs\2020-04-14T03_12_17_340Z-debug.log
```
My Package.json file:
```
{
"name": "hy",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "electron .",
"rebuild": "electron-rebuild -f -w sqlite3"
},
"author": "",
"license": "ISC",
"dependencies": {
"electron": "^8.2.2",
"sqlite3": "^4.1.1"
},
"devDependencies": {
"electron-rebuild": "^1.10.1"
}
}
```
Contributor guide
Research direction
Start by reproducing the reported npm run rebuild command with electron-rebuild -f -w sqlite3 and inspect the MSBuild, node-gyp, and command-path errors in the log. The issue does not name a source file or test; done would mean identifying the cause and confirming that the native SQLite module rebuild completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, node.js
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100