Javascript 启动使用electron构建的应用程序';行不通

Javascript 启动使用electron构建的应用程序';行不通,javascript,node.js,build,electron,Javascript,Node.js,Build,Electron,这是我的问题: 我正在学习electron,想知道使用electron构建应用程序时的情况。所以我决定克隆一个使用electron的现有应用程序,看看会发生什么。一切正常,在生成.exe时没有错误。然后,使用生成的安装程序安装应用程序。当我启动应用程序时。。。没有什么。没有错误,任务管理器说应用程序正在运行,但没有windows 我试过了: 为了查看问题是否不是代码本身(这应该可以工作,因为它是一个流行的应用程序),我使用npm start(electron webpack dev,如果我没记错

这是我的问题:

我正在学习electron,想知道使用electron构建应用程序时的情况。所以我决定克隆一个使用electron的现有应用程序,看看会发生什么。一切正常,在生成.exe时没有错误。然后,使用生成的安装程序安装应用程序。当我启动应用程序时。。。没有什么。没有错误,任务管理器说应用程序正在运行,但没有windows

我试过了:

为了查看问题是否不是代码本身(这应该可以工作,因为它是一个流行的应用程序),我使用npm start(electron webpack dev,如果我没记错的话)启动了该应用程序,并且一切正常。我没有更改代码,显然我安装了npm。由于它不是我的应用程序,我完全不知道为什么在构建它时应用程序不工作。当然,当我在他们的网站上下载.exe时,它工作得非常好

package.json

{
  "name": "scratch-desktop",
  "productName": "Scratch Desktop",
  "description": "Scratch 3.0 as a self-contained desktop application",
  "author": "Scratch Foundation",
  "version": "3.9.0",
  "license": "BSD-3-Clause",
  "scripts": {
    "start": "electron-webpack dev --bail --display-error-details --env.minify=false",
    "build-gui": "node ./scripts/run-in-gui.js build",
    "watch-gui": "node ./scripts/run-in-gui.js watch",
    "clean": "rimraf ./dist/ ./static/assets/",
    "compile": "rimraf ./dist/ && electron-webpack --bail --display-error-details --env.minify=false",
    "fetch": "rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMediaLibraryAssets.js",
    "dist": "npm run build-gui && npm run fetch && npm run compile -p && node ./scripts/electron-builder-wrapper.js",
    "dist:dir": "npm run dist -- --dir -c.compression=store -c.mac.identity=null",
    "lint": "eslint --cache --color --ext .jsx,.js ."
  },
  "repository": {
    "type": "git",
    "url": "git+ssh://git@github.com/LLK/scratch-desktop.git"
  },
  "dependencies": {
    "source-map-support": "^0.5.12",
    "scratch-gui": "github:LLK/scratch-gui#scratch-desktop"
  },
  "devDependencies": {
    "@babel/core": "^7.5.4",
    "@babel/plugin-proposal-object-rest-spread": "^7.5.4",
    "@babel/plugin-syntax-dynamic-import": "^7.2.0",
    "@babel/plugin-transform-async-to-generator": "^7.5.0",
    "@babel/preset-env": "^7.5.4",
    "@babel/preset-react": "^7.0.0",
    "async": "^2.6.2",
    "babel-eslint": "^10.0.3",
    "babel-loader": "^8.0.6",
    "babel-plugin-react-intl": "^2.3.1",
    "copy-webpack-plugin": "^4.6.0",
    "electron": "^6.1.7",
    "electron-builder": "^22.2.0",
    "electron-devtools-installer": "^2.2.4",
    "electron-notarize": "^0.2.1",
    "electron-store": "^3.3.0",
    "electron-webpack": "^2.7.4",
    "eslint": "^5.16.0",
    "eslint-config-scratch": "^5.0.0",
    "eslint-plugin-import": "^2.18.0",
    "eslint-plugin-react": "^7.14.2",
    "intl": "1.2.5",
    "lodash.bindall": "^4.4.0",
    "lodash.defaultsdeep": "^4.6.1",
    "mkdirp": "^0.5.1",
    "nets": "^3.2.0",
    "react": "16.2.0",
    "react-dom": "16.2.1",
    "react-intl": "2.4.0",
    "react-redux": "5.0.7",
    "redux": "3.7.2",
    "rimraf": "^2.7.1",
    "source-map-loader": "^0.2.4",
    "uglifyjs-webpack-plugin": "^2.1.3",
    "uuid": "^3.3.3",
    "webpack": "^4.39.3"
  },
  "resolutions": {
    "upath": "^1.0.5"
  }
}

那么,我做错了什么,该怎么做才能让这个应用程序正常工作呢


感谢您的回答,如果您有任何问题,请不要犹豫。

您的构建配置工作不正常。无论何时尝试在prod app中打开开发人员控制台。然后它会显示错误原因。也许,至少应用程序找不到条目
index.html
你能用你的package.json和项目结构的截图发布吗?@tpikachu我用package.json和项目结构的截图编辑了我的帖子你的构建配置工作不正常。无论何时尝试在prod app中打开开发人员控制台。然后它会显示错误,为什么它没有呈现。也许,至少应用程序找不到条目
index.html
你能用你的package.json和项目结构的截图发布吗?@tpikachu我用package.json和项目结构的截图编辑了我的帖子