I use windows 10 as a main OS.
Today, due to some issues I had to delete and reclone the repo. So I just cloned the source code from GitHub, Then I ran npm install
command and got error. Here is my terminal log:
R:\Dev\joplin-kowalskidev>npm install
> husky@3.0.2 install R:\Dev\joplin-kowalskidev\node_modules\husky
> node husky install
husky > Setting up git hooks
husky > Done
> husky@3.0.2 postinstall R:\Dev\joplin-kowalskidev\node_modules\husky
> opencollective-postinstall || true
Thank you for using husky!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/husky/donate
> joplin@1.0.0 postinstall R:\Dev\joplin-kowalskidev
> cd Tools && npm i && cd .. && cd ReactNativeClient && npm i && cd .. && cd ElectronClient && npm i && cd .. && cd CliClient && npm i && cd
.. && gulp build
added 138 packages from 151 contributors and audited 174 packages in 22.122s
found 0 vulnerabilities
> core-js@2.6.11 postinstall R:\Dev\joplin-kowalskidev\ReactNativeClient\node_modules\fbjs-scripts\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> core-js@2.6.11 postinstall R:\Dev\joplin-kowalskidev\ReactNativeClient\node_modules\metro-babel-register\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@2.6.11 postinstall R:\Dev\joplin-kowalskidev\ReactNativeClient\node_modules\metro\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@2.6.11 postinstall R:\Dev\joplin-kowalskidev\ReactNativeClient\node_modules\react-native\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> Joplin@0.8.0 postinstall R:\Dev\joplin-kowalskidev\ReactNativeClient
> patch-package --patch-dir ../patches && jetify && npm run build
patch-package 6.2.1
Applying patches...
htmlparser2@4.1.0 ✔
sax@1.2.4 ✔
Jetifier found 1235 file(s) to forward-jetify. Using 8 workers...
> Joplin@0.8.0 build R:\Dev\joplin-kowalskidev\ReactNativeClient
> gulp build
[17:58:31] Using gulpfile R:\Dev\joplin-kowalskidev\ReactNativeClient\gulpfile.js
[17:58:31] Starting 'build'...
[17:58:31] Starting 'buildReactNativeInjectedJs'...
[17:58:31] Finished 'buildReactNativeInjectedJs' after 13 ms
[17:58:31] Starting 'encodeAssets'...
[17:58:32] Finished 'encodeAssets' after 532 ms
[17:58:32] Starting 'podInstall'...
[17:58:32] Finished 'podInstall' after 1.47 ms
[17:58:32] Finished 'build' after 553 ms
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
added 1250 packages from 913 contributors and audited 75105 packages in 204.543s
4 packages are looking for funding
run `npm fund` for details
found 96 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
> sqlite3@4.1.1 install R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
[sqlite3] Success: "R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\sqlite3\lib\binding\node-v72-win32-x64\node_sqlite3.node" is installed via remote
> ejs@3.0.1 postinstall R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\ejs
> node ./postinstall.js
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
> core-js@3.6.4 postinstall R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\global-agent\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> electron@7.1.14 postinstall R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\electron
> node install.js
> Joplin@1.0.197 postinstall R:\Dev\joplin-kowalskidev\ElectronClient
> npm run build && gulp electronRebuild
> Joplin@1.0.197 build R:\Dev\joplin-kowalskidev\ElectronClient
> patch-package --patch-dir ../patches && gulp build
patch-package 6.2.0
Applying patches...
htmlparser2@4.1.0 ✔
sax@1.2.4 ✔
[18:01:40] Using gulpfile R:\Dev\joplin-kowalskidev\ElectronClient\gulpfile.js
[18:01:40] Starting 'build'...
[18:01:40] Starting 'compileScripts'...
[18:01:40] Starting 'compilePackageInfo'...
[18:01:40] Starting 'copyPluginAssets'...
[18:01:40] Starting 'copyLib'...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/ClipperConfigScreen.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/ConfigMenuBar.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/ConfigScreen.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/DialogButtonRow.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/DropboxLoginScreen.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/EncryptionConfigScreen.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/ExtensionBadge.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/Header.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/HelpButton.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/IconButton.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/ImportScreen.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/ItemList.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/MainScreen.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/Navigator.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/NoteList.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/NotePropertiesDialog.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/NoteRevisionViewer.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/NoteSearchBar.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/NoteStatusBar.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/NoteText.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/NoteTextViewer.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/OneDriveLoginScreen.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/PromptDialog.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/Root.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/SideBar.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/StatusScreen.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/TagItem.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/TagList.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/Toolbar.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/ToolbarButton.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/ToolbarSpace.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/VerticalResizer.jsx...
Compiling R:\Dev\joplin-kowalskidev\ElectronClient\tools/../plugins/GotoAnything.jsx...
Copying to R:\Dev\joplin-kowalskidev\ElectronClient\tools/../gui/note-viewer/pluginAssets
[18:02:27] Finished 'compileScripts' after 48 s
[18:02:28] Finished 'compilePackageInfo' after 48 s
Copying to R:\Dev\joplin-kowalskidev\ElectronClient\tools/../pluginAssets
[18:02:28] Finished 'copyPluginAssets' after 48 s
[18:02:29] Finished 'copyLib' after 49 s
[18:02:29] Starting 'tsc'...
[18:02:41] Finished 'tsc' after 12 s
[18:02:41] Finished 'build' after 1.02 min
[18:02:44] Using gulpfile R:\Dev\joplin-kowalskidev\ElectronClient\gulpfile.js
[18:02:44] Starting 'electronRebuild'...
Running: "R:\Dev\joplin-kowalskidev\ElectronClient\tools/../node_modules/.bin/electron-rebuild.cmd" --arch ia32
[18:03:13] 'electronRebuild' errored after 29 s
[18:03:13] Error: Command failed: "R:\Dev\joplin-kowalskidev\ElectronClient\tools/../node_modules/.bin/electron-rebuild.cmd" --arch ia32
- Searching dependency tree
× 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\Zaid' 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. [R:\Dev\joplin-kowalskidev\ElectronClient\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 (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "R:\\Dev\\joplin-kowalskidev\\ElectronClient\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=7.1.14" "--arch=ia32" "--dist-url=https://electronjs.org/headers" "--build-from-source" "--module_name=node_sqlite3" "--module_path=R:\\Dev\\joplin-kowalskidev\\ElectronClient\\node_modules\\sqlite3\\lib\\binding\\electron-v7.1-win32-ia32" "--host=https://mapbox-node-binary.s3.amazonaws.com" "--remote_path=./{name}/v4.1.1/{toolset}/" "--package_name=electron-v7.1-win32-ia32.tar.gz"
gyp ERR! cwd R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\sqlite3
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v6.0.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.
unpack_sqlite_dep
'C:\Users\Zaid' 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. [R:\Dev\joplin-kowalskidev\ElectronClient\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 (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "R:\\Dev\\joplin-kowalskidev\\ElectronClient\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=7.1.14" "--arch=ia32" "--dist-url=https://electronjs.org/headers" "--build-from-source" "--module_name=node_sqlite3" "--module_path=R:\\Dev\\joplin-kowalskidev\\ElectronClient\\node_modules\\sqlite3\\lib\\binding\\electron-v7.1-win32-ia32" "--host=https://mapbox-node-binary.s3.amazonaws.com" "--remote_path=./{name}/v4.1.1/{toolset}/" "--package_name=electron-v7.1-win32-ia32.tar.gz"
gyp ERR! cwd R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\sqlite3
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v6.0.1
gyp ERR! not ok
Failed with exit code: 1
at SafeSubscriber._error (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\spawn-rx\lib\src\index.js:267:84)
at SafeSubscriber.__tryOrUnsub (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\rxjs\internal\Subscriber.js:205:16)
at SafeSubscriber.error (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\rxjs\internal\Subscriber.js:156:26)
at Subscriber._error (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\rxjs\internal\Subscriber.js:92:26)
at Subscriber.error (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\rxjs\internal\Subscriber.js:72:18)
at MapSubscriber.Subscriber._error (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\rxjs\internal\Subscriber.js:92:26)
at MapSubscriber.Subscriber.error (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\rxjs\internal\Subscriber.js:72:18)
at SafeSubscriber._next (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\spawn-rx\lib\src\index.js:242:65)
at SafeSubscriber.__tryOrUnsub (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\rxjs\internal\Subscriber.js:205:16)
at SafeSubscriber.next (R:\Dev\joplin-kowalskidev\ElectronClient\node_modules\rxjs\internal\Subscriber.js:143:22)
at ChildProcess.exithandler (child_process.js:303:12)
at ChildProcess.emit (events.js:311:20)
at ChildProcess.EventEmitter.emit (domain.js:505:15)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Joplin@1.0.197 postinstall: `npm run build && gulp electronRebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Joplin@1.0.197 postinstall 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\Zaid Kesarani\AppData\Roaming\npm-cache\_logs\2020-04-03T12_33_13_989Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! joplin@1.0.0 postinstall: `cd Tools && npm i && cd .. && cd ReactNativeClient && npm i && cd .. && cd ElectronClient && npm i && cd
.. && cd CliClient && npm i && cd .. && gulp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the joplin@1.0.0 postinstall 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\Zaid Kesarani\AppData\Roaming\npm-cache\_logs\2020-04-03T12_33_14_176Z-debug.log
R:\Dev\joplin-kowalskidev>npm start
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Zaid Kesarani\AppData\Roaming\npm-cache\_logs\2020-04-03T12_35_25_925Z-debug.log
I know this issue very well. This is related to SQlite dependency and we need to rebuild this again after installing SQLite. So for that we have electronRebuild.js
in ElectronClient > tools
to fix this issue but in this file there is a bug here:
console.info(await execCommand([`"${exePath}"`, `--arch ia32`].join(' ')));
To run electron-rebuild.cmd
we need to pass one command line arguments i.e module directory which is the path to package.json we have to pass argument like this --module-dir <path-to-package.json>
.
So here is my fix:
Replacing the --arch ia32
with --module-dir ${__dirname}/..
fix the issue! So the new code would be:
console.info(await execCommand([`"${exePath}"`, `--module-dir ${__dirname}/..`].join(' ')));
@laurent Can I open new GH issue regarding the same ?