- Clone the repository:
git clone https://github.com/HollaG/electron-git-mastery.git
- cd into it:
cd electron-git-mastery
- Install dependencies:
npm install
Start the application:
npm run dev
Notes:
npm run devstarts both Electron backend & React frontend
Note: The build process takes quite a while. Be patient and let it finish
npm run dist:win
Run the .exe to open the app.
Potential errors:
Error: Could not find any Visual Studio installation to use
at VisualStudioFinder.fail (I:\Coding\electron\electron-git-mastery\node_modules\node-gyp\lib\find-visualstudio.js:118:11)
at VisualStudioFinder.findVisualStudio (I:\Coding\electron\electron-git-mastery\node_modules\node-gyp\lib\find-visualstudio.js:74:17)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async createBuildDir (I:\Coding\electron\electron-git-mastery\node_modules\node-gyp\lib\configure.js:112:18)
at async process.<anonymous> (file:///I:/Coding/electron/electron-git-mastery/node_modules/@electron/rebuild/lib/module-type/node-gyp/worker.js:22:13)
Fix: install Visual Studio Build Tools
-
Download Visual Studio Build Tools https://visualstudio.microsoft.com/visual-cpp-build-tools/
-
In the installer, select:
Desktop development with C++
-
Make sure these are included:
-
MSVC v143 C++ build tools
-
Windows 10/11 SDK
-
C++ CMake tools for Windows
-
Restart terminal / VS Code.
-
Run the command again.
C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Microsoft\VC\v180\Microsoft.CppBuild.targets(524,5): error MSB8040: Spectre-mitigated libraries are required for this project. Install them from the Visual Studio installer (Individual components tab) for any toolsets and architectures being used. Learn more: https://aka.ms/Ofhn4c [I:\Coding\electron\electron-git-mastery\node_modules\node-pty\build\conpty.vcxproj]
Fix: Install Spectre libraries
npm run dist:mac
Outputs:
-
.dmgindist/git-mastery-{version}-arm64.dmg -
.app(portable) indist/mac-arm64/git-mastery.app
Special note for MacOS: Due to Apple restricting unsigned builds, users must run the following command before opening the app:
xattr -rc /Applications/git-mastery.app
Failure to run this command will result in an error saying that the app can't be opened.
npm run dist:linux