0
我是Electron的新手,試圖創建一個簡單的應用程序。我不想在全球安裝電子。而是希望僅在應用程序中安裝它。當我運行npm run start時,沒有任何反應。只是電子。顯示在命令行上。什麼是錯我的代碼和任何地方,我可以看到日誌電子應用程序未啓動
我appstructure: MusicPlayer
- APP-> index.html的
- node_modules
- main.js
- 包。 json
Package.json是:
{
"name": "musicplayer",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"author": "ABC",
"devDependencies": {
"electron": "^1.6.11"
}
}
Main.js是:
const electron = require ('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
var mainWindow = null;
function createWindow()
{
mainWindow = new BrowserWindow({width:612,height:384});
mainWindow.loadURL(`file://${__dirName}/app/index.html`);
}
app.on('ready', createWindow)
似乎並不被幫助。可能是我的安裝有問題。我甚至在全球安裝電子。試過電子快速啓動。即使是在顯示電子後,它也會掛起。沒有窗戶打開。有任何想法嗎?只是增加我在WIndows 10 – user6223198
我想嘗試卸載所有電子的東西,然後再次安裝 – ocboogie
@ user6223198你還試過[電子僞造](https://github.com/electron-userland/electron-forge)? – ocboogie