Hi I’ve just completed my first build of Joplin on Windows. Here’s a grab-bag of problems I encountered and my work-arounds. These problems were all self-inflicted and not flaws in Joplin itself.
My development environment:
os: Win 10
cli: mix of >powershell and $gitbash
I set myself up with the first problem by not following the standard build instructions and diving straight into the Windows build hints . The standard build instructions caution ‘Before building any of the applications, you need to build the tools’. Next time I would follow the standard build instructions until encountering a problem, then hit the Windows hints.
Building the Electron application - Problem #1
$ cd ElectronApp/app $ npm install ... Error: Cannot find module 'fs-extra'
Installing the Tools first fixes this.
$ npm install ... An unhandled error occurred inside electron-rebuild gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python ",
For future flexibility I install Python with the excellent pyenv
$ npm install ... An unhandled error occurred inside electron-rebuild gyp ERR! configure error gyp ERR! stack Error: Command failed: .pyenv\pyenv-win\shims\python.BAT -c import sys; print("%s.%s.%s "% sys.version_info[:3]);
Unfortunately pyenv proxies the python executable through a batch file that struggles with cli scripts. So I find my actual python.exe and drop it into %PATH% one place ahead of pyenv.
$ npm install ... error MSB3428: Could not load the Visual C++ component "VCBuild.exe ". To fix this, 1) install the .NET Framework 2.0 SDK
I needed an additional parameter to the windows-build-tools install. Thank you stackoverflow . No, not just the --vs2015, but --production!
admin powershell >npm --vs2015 install --global --production windows-build-tools
Closer now. It looks to have installed but
$ npm list --depth=0 Joplin@1.0.165 Joplin\src\joplin\ElectronClient\app +-- UNMET OPTIONAL DEPENDENCY email@example.com +-- UNMET OPTIONAL DEPENDENCY firstname.lastname@example.org +-- email@example.com ... npm ERR! peer dep missing: ajv@^6.9.1, required by firstname.lastname@example.org
Hmmm, a dependency doesn’t like Windows. Yes it does, it made friends in a later version .
$ npm uninstall ajv $ npm install email@example.com --save
Next stop, build happiness.