node.js - 运行电子应用程序时出现错误时我能做什么
问题描述
我通过 electronjs 文档制作了我的第一个电子应用程序。我使用命令运行了应用程序npm start
,但这向我显示了这个错误
$ npm 开始
my-electron-app@1.0.0 启动 C:\Users\aksha\OneDrive\Desktop\ElcDocStarter\my-electron-app electron 。
'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 模块:
npm i -g electron
推荐阅读
- arrays - 如何在postgresql中为包含varchar(2)ARRAY [50]类型的输入变量的函数传递参数
- java - Mockito 模拟 NullPointerException,不知道还有什么可以尝试的
- swift - Admob 测试广告和真实广告均未展示
- r - 如何查找具有非英文值的列的名称?R
- python - 当我尝试用他们的等级替换它的元素时,任何人都可以帮助我处理 python 列表中的关系吗?
- json - hcl, json, go:如何迭代 JSON?
- git - GIT 的承诺超出了它的需要
- c++ - Avoiding branching using arrays
- python - 如何动态创建异常类
- apache-spark - pyspark:从时间戳中删除毫秒