【问题标题】:what I can when there is error while running electron app运行电子应用程序时出现错误时我能做什么
【发布时间】:2021-05-20 04:37:35
【问题描述】:

我通过 electronjs 文档制作了我的第一个电子应用程序。 我使用npm start 命令运行应用程序, 但是这向我显示了这个错误

$ npm 开始

my-electron-app@1.0.0 启动 C:\Users\aksha\OneDrive\Desktop\ElcDocStarter\my-electron-app 电子。

'electron' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-electron-app@1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-electron-app@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\aksha\AppData\Roaming\npm-cache\_logs\2021-02-17T08_15_08_284Z-debug.log

【问题讨论】:

  • 您是否安装了 electron 作为全局模块? npm i -g electron
  • 添加电子路径,作为路径env,architectryan.com/2018/03/17/add-to-the-path-on-windows-10
  • 不,我没有......
  • @NullDev 感谢您的帮助,我的应用程序正在运行
  • 好吧,在这种情况下,我会将其发布为答案,以便我们将此问题标记为已解决:)

标签: node.js npm electron


【解决方案1】:

electron 安装为全局 NPM 模块:

npm i -g electron

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-14
    • 2018-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多