电子启动脚本错误

时间:2017-12-20 09:09:16

标签: windows electron exe electron-builder electron-packager

我正在运行一个webpack项目并运行此脚本
我的 package.json 看起来像这样

{
    "name": "collab-ui",
    "version": "0.0.10",
    "author": {
        "name": "some-name",
        "email": "some-emailId"
    },
    "main": "electron.js",
    "scripts": {
        "start": "rimraf debug && npm outdated && webpack --watch",
        "http": "rimraf debug && npm outdated && webpack --watch",
        "release": "rimraf dist && webpack --bail --progress --profile",
        "elecstart": "rimraf debug && webpack &&  electron .",
        "elecrel": "electron-packager . XorChat --all",
    },
    "devDependencies": {
        "@types/jquery": "2.0.41",
        "api-ai-javascript": "^2.0.0-beta.21",
        "autoprefixer": "~6.7.7",
        "awesome-typescript-loader": "~3.1.2",
        "browser-sync": "~2.18.8",
        "browser-sync-webpack-plugin": "~1.1.4",
        "css-loader": "~0.27.3",
        "custom-event-polyfill": "~0.3.0",
        "electron": "^1.7.9",
        "electron-packager": "^9.1.0",
        "es6-promise": "~4.1.1",
        "extract-text-webpack-plugin": "~2.1.0",
        "file-loader": "~0.10.1",
        "html-loader": "~0.4.5",
        "html-webpack-plugin": "~2.28.0",
        "html5-notification": "~3.0.0",
        "http-proxy-middleware": "~0.17.4",
        "import-glob-loader": "~1.1.0",
        "knockout": "~3.4.2",
        "live-server": "~1.2.0",
        "node-sass": "~4.5.0",
        "open-browser-webpack-plugin": "~0.0.5",
        "postcss-loader": "~1.3.3",
        "qrcode-generator": "~1.3.1",
        "resolve-url-loader": "~2.1.0",
        "rimraf": "~2.6.1",
        "sass-loader": "~6.0.3",
        "socket.io-client": "~2.0.3",
        "store": "~2.0.12",
        "style-loader": "~0.14.1",
        "ts-loader": "~2.0.2",
        "typescript": "~2.2.1",
        "url-loader": "~0.5.8",
        "webpack": "~2.2.1",
        "webpack-dev-middleware": "~1.10.1",
        "webpack-dev-server": "~2.4.2",
        "webpack-hot-middleware": "~2.17.1",
        "webpack-stream": "~3.2.0",
        "webrtc-adapter": "^6.0.2",
        "uuid": "^3.1.0"
    }
}


我的 electron.js 看起来像这样

const electron = require('electron');
 const { app, BrowserWindow } = electron;
 app.commandLine.appendSwitch("ignore-certificate-errors");
 app.on('ready', () => {

     let win = new BrowserWindow({ width: 800, height: 600 });
     win.loadURL(`file://${__dirname}/debug/index.html`);
     win.webContents.openDevTools();
 })


但是在运行 npm run elecstart 之后,我收到了这个错误 enter image description here

任何线索,为什么我收到此错误。我在Windows 10 64bit,8 gb ram(FYI)上运行,但在运行脚本之后,窗口错误框如图所示,在我关闭之后,脚本停止。我怀疑某些JS错误在那里,因为它无法找到某些符号或缺少某些配置。任何帮助表示赞赏。

0 个答案:

没有答案