第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

電子應(yīng)用程序不會啟動,準(zhǔn)備就緒時(shí)不存在

電子應(yīng)用程序不會啟動,準(zhǔn)備就緒時(shí)不存在

慕碼人8056858 2022-06-16 15:26:16
我已經(jīng)做了幾天了,我已經(jīng)從 Electron GitHub 克隆了電子快速啟動(https://github.com/electron/electron-quick-start)我收到了這個(gè)錯(cuò)誤,但它不是t 只為這個(gè)應(yīng)用程序,它是所有的應(yīng)用程序。我不知道發(fā)生了什么。電子最新版本:8.2.0 錯(cuò)誤app.whenReady().then(createWindow)     ^TypeError: Cannot read property 'whenReady' of undefined    at Object.<anonymous> (/Users/user/Downloads/electron-quick-start-master/main.js:25:5)    at Module._compile (internal/modules/cjs/loader.js:1147:30)    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)    at Module.load (internal/modules/cjs/loader.js:996:32)    at Function.Module._load (internal/modules/cjs/loader.js:896:14)    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)    at internal/main/run_main_module.js:17:47代碼:const electron = require('electron')// Modules to control application life and create native browser windowconst {app, BrowserWindow} = require('electron')const path = require('path')function createWindow () {  // Create the browser window.  const mainWindow = new BrowserWindow({    width: 800,    height: 600,    webPreferences: {      preload: path.join(__dirname, 'preload.js')    }  })  // and load the index.html of the app.  mainWindow.loadFile('index.html')  // Open the DevTools.  // mainWindow.webContents.openDevTools()}// This method will be called when Electron has finished// initialization and is ready to create browser windows.// Some APIs can only be used after this event occurs.app.whenReady().then(createWindow)// Quit when all windows are closed.app.on('window-all-closed', function () {  // On macOS it is common for applications and their menu bar  // to stay active until the user quits explicitly with Cmd + Q  if (process.platform !== 'darwin') app.quit()})app.on('activate', function () {  // On macOS it's common to re-create a window in the app when the  // dock icon is clicked and there are no other windows open.  if (BrowserWindow.getAllWindows().length === 0) createWindow()})
查看完整描述

3 回答

?
慕尼黑5688855

TA貢獻(xiàn)1848條經(jīng)驗(yàn) 獲得超2個(gè)贊

本身不是一個(gè)答案——我只是在Electron我目前正在進(jìn)行的一個(gè)項(xiàng)目中嘗試了這個(gè),它運(yùn)行良好:


app.whenReady().then((choice) => {

    console.log("hey, I'm ready", choice);   

})

對于現(xiàn)實(shí)檢查,我建議使用 ready 事件:


app.on('ready', function () {

  console.log("hey, I'm ready too!");   

});

Electron盡管我突然想問:您使用的是什么版本?如果您使用的是 7 或 8 之前的版本,他們還沒有開始“承諾”的東西(我忘記了開始使用的版本Promises)


查看完整回答
反對 回復(fù) 2022-06-16
?
米脂

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超3個(gè)贊

您的電子版本低于 v3.0.0。

我們可以whenReady()從 3.0.0 版本開始使用。建議您更新您的電子版。


查看完整回答
反對 回復(fù) 2022-06-16
?
繁星淼淼

TA貢獻(xiàn)1775條經(jīng)驗(yàn) 獲得超11個(gè)贊

謝謝大家?guī)椭?,但我已?jīng)解決了這個(gè)問題:我所要做的就是在前兩行之后加上分號,


const {app, BrowserWindow} = require('electron');

const path = require('path');

而不是這個(gè)


const {app, BrowserWindow} = require('electron')

const path = require('path')


查看完整回答
反對 回復(fù) 2022-06-16
  • 3 回答
  • 0 關(guān)注
  • 176 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號