如何使用electronic-forge应用程序安装和运行sqlite3? 每当我尝试安装新项目并添加sqlite3时,总会缺少依赖项和错误。
我已尝试使用npm install sqlite3 --build-from-source
进行安装,但在此之后,当我启动应用程序时,它会断开并报告整个地方缺少依赖项。安装后它可以工作,但包和make被破坏,出现以下错误:
> electron-forge package
√ Checking your system
√ Preparing to Package Application for arch: x64
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\dbnavigator.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\dbnavigator.xml resulted in a MIME type of application/xml, which we don't know how to handle
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\encodings.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\encodings.xml resulted in a MIME type of application/xml, which we don't know how to handle
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\jsLibraryMappings.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\jsLibraryMappings.xml resulted in a MIME type of application/xml, which we don't know how to handle
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\markdown-navigator\profiles_settings.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\markdown-navigator\profiles_settings.xml resulted in a MIME type of application/xml, which we don't know how to handle
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\markdown-navigator.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\markdown-navigator.xml resulted in a MIME type of application/xml, which we don't know how to handle
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\misc.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\misc.xml resulted in a MIME type of application/xml, which we don't know how to handle
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\modules.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\modules.xml resulted in a MIME type of application/xml, which we don't know how to handle
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\vcs.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\vcs.xml resulted in a MIME type of application/xml, which we don't know how to handle
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\watcherTasks.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\watcherTasks.xml resulted in a MIME type of application/xml, which we don't know how to handle
Failed to compile file: C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\workspace.xml
Compiling C:\Users\neman\AppData\Local\Temp\electron-packager\win32-x64\rentacar-manager-win32-x64\resources\app\.idea\workspace.xml resulted in a MIME type of application/xml, which we don't know how to handle
√ Compiling Application
√ Preparing native dependencies: 1 / 1
√ Packaging Application
答案 0 :(得分:0)
npm install --save-dev electron-rebuild
npm install --save-dev electron-prebuilt
.\node_modules\.bin\electron-rebuild.cmd
我试过,这很有效。
但是在重建之后,我的电子版本变为v1.1 +,我不能使用“async”,因为节点版本低于7.0。
如果您不关心是否使用ES7,请尝试这种方式。