使用npx electron-forge import命令时报错Could not find git in environment的解决方法

准备使用Electron Forge​打包项目文件时(打包您的应用程序 | Electron)可能会遇到以下错误:

使用npx electron-forge import命令时报错Could not find git in environment的解决方法_第1张图片

 解决方法:在git的官网(Git for Windows)上下载安装git,然后在git bash的窗体中运行命令即可。

使用npx electron-forge import命令时报错Could not find git in environment的解决方法_第2张图片

(git的官网)

使用npx electron-forge import命令时报错Could not find git in environment的解决方法_第3张图片

 git下载安装完成后会自动启动git bash,在其中输入并执行命令npx electron-forge import即可。

 

你可能感兴趣的:(electron,javascript,前端)