【发布时间】:2021-06-05 13:24:21
【问题描述】:
我是电子新手,并在此处遵循快速入门指南:https://www.electronjs.org/docs/tutorial/quick-start
我的package.json 有这个:
"scripts": {
"start": "electron ."
}
当我运行 npm start 时,应用程序启动但版本未打印,并且我在 js 控制台中收到这些错误:
Uncaught ReferenceError: process is not defined at index.html:11
Uncaught ReferenceError: process is not defined at index.html:12
Uncaught ReferenceError: process is not defined at index.html:13
似乎process 没有在 index.html 中定义。但是当我直接运行electron . 时,一切正常。
为什么?
我的版本:
Manjaro 20.2.1,内核 5.10.18-1-MANJARO
Node.js 15.10.0
npm 7.6.1
电子12.0.0
【问题讨论】:
-
启用节点集成
-
正如我所写,我是电子初学者,并按照快速入门指南进行操作。你能详细说明一下吗?
标签: node.js npm electron npm-scripts npm-start