我正在使用电子和webpack。
在建立开发模式时,我的专案。
出现节点错误“ UnhandledPromiseRejectionWarning:未处理的诺言拒绝(拒绝ID:1):错误:已用代码2退出” .js进程使用非零退出代码。”。
而且剂量不能打开电子。
我检查了防火墙。
我目前如何设置我的项目?
这是我的package.json。
{
"name": "abce",
"productName": "abce Launcher",
"version": "0.10.0",
"main": "main.js",
"scripts": {
"test": "cross-env NODE_ENV=test node --trace-warnings ./test/runTests.js",
"test-all": "npm run test && npm run build && npm run test-e2e",
"test-watch": "npm test -- --watch",
"test-e2e": "cross-env NODE_ENV=test node --trace-warnings ./test/runTests.js e2e",
"hot-server": "cross-env NODE_ENV=development node --max_old_space_size=4096 server.js",
"build-main": "cross-env NODE_ENV=production node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack --config webpack.config.electron.js --progress --profile --colors",
"build-renderer": "cross-env NODE_ENV=production node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack --config webpack.config.production.js --progress --profile --colors",
"build-web": "cross-env NODE_ENV=production node --max_old_space_size=4096 --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.web.production.js --progress --profile --colors",
"build": "npm run deploy-content-api && npm run build-main && npm run build-renderer",
"start": "cross-env NODE_ENV=production electron ./app/",
"start-hot": "cross-env HOT=1 NODE_ENV=development electron -r babel-register -r babel-polyfill ./app/main.development",
"postinstall": "npm run build",
"dev": "npm run deploy-content-api && npm run hot-server -- --start-hot",
"dev-web": "cross-env NODE_ENV=development node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.web.development.js --progress --profile --colors",
"dev-web-hot": "cross-env START_HOT=1 NODE_ENV=development node --trace-warnings ./node_modules/webpack-dev-server/bin/webpack-dev-server --config webpack.config.web.development.js",
"package": "npm run build && build --publish never",
"package-win": "npm run build && build --win --x64",
"package-linux": "npm run build && build --linux",
"package-all": "npm run build && build -mwl",
"cleanup": "mop -v",
"deploy-content-api": "cross-env uglifyjs ./content-api/tree-launcher-content.js -c -m -o ./app/public/tree-launcher-content.js",
"prettier": "prettier --write \"**/*.*(js|jsx|ts|tsx)\""
},
"jest": {
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/fileMock.js",
"\\.(css|less|sass|scss)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"moduleDirectories": [
"node_modules",
"app/node_modules"
],
"transform": {
"^.+\\.(ts|tsx)$": "<rootDir>/test/preprocessor.js"
},
"testMatch": [
"**/?(*.)(spec|test).ts?(x)"
]
},
"build": {
"productName": "Elif Launcher",
"appId": "com.visang.fel-launcher",
"asar": false,
"dmg": {
"contents": [
{
"x": 410,
"y": 150,
"type": "link",
"path": "/Applications"
},
{
"x": 130,
"y": 150,
"type": "file"
}
]
},
"files": [
"dist/",
"!dist/**/*.*.map",
"node_modules/",
"app.html",
"main.js",
"fel.sql",
"fel.yaml",
"fel_server.exe",
"OSKSpawner.exe",
"static/",
"public/",
"package.json",
"settings.json"
],
"directories": {
"buildResources": "resources",
"output": "release"
},
"win": {
"target": "dir"
},
"linux": {
"target": [
"deb",
"AppImage"
]
}
},
"bin": {
"electron": "./node_modules/.bin/electron"
},
"devDependencies": {
"@types/enzyme": "^2.5.39",
"@types/history": "^4.5.2",
"@types/jest": "^20.0.2",
"@types/node": "~8.0.2",
"@types/react": "^15.0.37",
"@types/react-dom": "^15.5.1",
"@types/react-hot-loader": "^3.0.1",
"@types/react-redux": "^5.0.4",
"@types/react-router": "^4.0.11",
"@types/react-router-dom": "^4.0.7",
"@types/react-router-redux": "^5.0.2",
"@types/redux-logger": "^3.0.0",
"@types/sinon": "^2.3.1",
"asar": "^0.13.0",
"babel-eslint": "^7.2.3",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-dynamic-import-webpack": "^1.0.1",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-register": "^6.26.0",
"boiler-room-custodian": "^0.6.2",
"concurrently": "^3.1.0",
"copy-webpack-plugin": "^4.0.1",
"cross-env": "^5.0.1",
"css-loader": "^0.28.4",
"css-modules-require-hook": "^4.0.6",
"devtron": "^1.4.0",
"electron": "1.6.7",
"electron-builder": "^19.8.0",
"electron-builder-http": "^19.15.0",
"electron-devtools-installer": "^2.0.1",
"electron-rebuild": "^1.6.0",
"enzyme": "^2.7.0",
"eslint": "^4.6.1",
"eslint-config-airbnb": "^15.1.0",
"eslint-formatter-pretty": "^1.3.0",
"eslint-import-resolver-webpack": "^0.8.3",
"eslint-plugin-compat": "^1.0.4",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^7.3.0",
"express": "^4.14.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "1.1.5",
"html-webpack-plugin": "^2.24.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^20.0.4",
"json-loader": "^0.5.4",
"node-sass": "^4.1.1",
"prettier": "^1.18.2",
"react-addons-test-utils": "^15.4.1",
"react-hot-loader": "^3.0.0-beta.6",
"redux-logger": "^3.0.6",
"sass-loader": "^6.0.6",
"sinon": "^3.2.1",
"spectron": "^3.4.1",
"style-loader": "^0.18.2",
"ts-loader": "^2.2.0",
"ts-node": "^3.1.0",
"tslint": "5.15.0",
"tslint-config-prettier": "^1.18.0",
"tslint-loader": "^3.5.3",
"tslint-react": "^3.2.0",
"typescript": "3.4.3",
"uglify-js": "^3.4.4",
"url-loader": "^0.5.7",
"webpack": "^3.3.0",
"webpack-dev-middleware": "^1.9.0",
"webpack-hot-middleware": "^2.13.2",
"webpack-merge": "^2.0.0"
},
"dependencies": {
"@types/classnames": "^2.2.9",
"babili-webpack-plugin": "^0.1.2",
"classnames": "^2.2.6",
"electron-debug": "^1.2.0",
"font-awesome": "^4.7.0",
"google-protobuf": "^3.3.0",
"grpc": "^1.3.2",
"history": "^4.6.3",
"md5-file": "^4.0.0",
"moment": "^2.19.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-draggable": "^3.0.5",
"react-id-swiper": "1.5.7",
"react-progressbar.js": "^0.2.0",
"react-redux": "^5.0.5",
"react-router": "^4.1.1",
"react-router-dom": "^4.1.1",
"react-router-redux": "^5.0.0-alpha.6",
"redux": "^3.7.1",
"redux-saga": "^0.15.3",
"rxjs": "^5.4.0",
"source-map-support": "~0.4.15",
"uuid": "^3.1.0",
"winston": "2.4.0",
"winston-daily-rotate-file": "^1.4.6"
},
"devEngines": {
"node": ">=6.x",
"npm": ">=3.x"
}
}