Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 Electron 应用程序使用 nodejs 依赖项(在我的情况下是 mysqljs),并且在开发模式下运行时运行良好。
但是,当我构建它并作为本机桌面应用程序启动时,它失败了:
电子错误错误:找不到模块'mysql'需要堆栈:...
问题是我不小心放在mysql了devDependencies我的package.json文件之间。
mysql
devDependencies
package.json
相反,它应该放置在 中,dependencies因为它应该随应用程序一起提供。
dependencies