首页 > 解决方案 > 电子应用程序不会运行。不知道为什么

问题描述

当输入 npm start 它给了我这个错误:

npm ERR! errno 1
npm ERR! helloworld@1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the helloworld@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?

这是 package.json

{
  "name": "helloworld",
  "version": "1.0.0",
  "description": "my app",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "author": "kamalyaka",
  "license": "MIT"
}

请帮忙。

标签: npmelectron

解决方案


您需要首先安装所有依赖项。尝试执行

npm install

首先在您的项目目录中。安装依赖项后,您可以执行

npm start

这将启动您的电子应用程序。


推荐阅读