在构建电子的角度投影时,我遇到了构建失败的错误。
当我使用此命令npm run electron-build
时,我得到了:
ERROR in ./node_modules/electron/index.js
Module not found: Error: Can't resolve 'fs' in
'G:\pos\node_modules\electron'
ERROR in ./node_modules/electron/index.js
Module not found: Error: Can't resolve 'path' in
'G:\pos\node_modules\electron'
ERROR in src/app/app.module.ts(60,49): error TS2339: Property 'fireConfig'
does not exist on type '{ production: boolean; }'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pos@0.0.0 electron-build: `ng build --prod && electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pos@0.0.0 electron-build script.
npm ERR! This is probably not a problem with npm. There is likely additional
logging output above.
npm ERR! A complete log of this run can be found in:
ERR! C:\Users\AppData\Roaming\npm-cache\_logs\2019-02-17T15_49_13_982Z-
debug.log
我删除了节点模块并重新安装,但仍然出现相同的错误
答案 0 :(得分:2)
问题可能是您的中没有
fireConfig
。
在您的environment.prod.ts
文件中,添加您在environment.prod.ts
中使用的fireConfig
。