이 코드를 실행하려고하는데이 오류 메시지가 나타날 때마다 실행하려고합니다. 먼저 npm
을 전 세계에 설치했습니다. 그럼 내 애플 리케이션 내에 설치했지만 여전히 같은 오류가 발생.전자 자바 스크립트에서 정의되지 않은 'on'속성을 읽을 수 없습니다.
Uncaught TypeError: Cannot read property 'on' of undefined at Object. (H:\electric\main.js:12:4) at Object. (H:\electric\main.js:63:3) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at file:///H:/electric/views/login.html:2:3
const electron = require('electron');
const {Menu} = require('electron');
const {app} = require('electron');
const {BrowserWindow} = require('electron');
const conn = require('mysql');
const path = require('path');
const url = require('url');
// const app = electron.app;
// const BrowserWindow = electron.BrowserWindow;
var mainWindow = null;
app.on('ready', function() {
mainWindow = new BrowserWindow({ width: 1024, height: 768, backgroundcolor: '#2e2c29' });
mainWindow.loadURL(url.format({
pathname: 'popupcheck.html',
protocol: 'file:',
slashes: true
}));enter code here
mainWindow.webContents.openDevTools();
mainWindow.setProgressBar(1);
});`][1]
앱의 PLZ 인쇄 오류를 추가 할 수 있습니다. –
잡히지 않은 TypeError : 객체에서 정의되지 않은 의 'on'속성을 읽을 수 없습니다. (H : \ electric \ main.js : 12 : 4) at 개체. (Module.js : 580 : 10) (H : \ electric \ main.js : 63 : 3) at Module._compile (module.js : 571 : 32) at Object.Module._extensions..js (module.js : 580 : 10) at Function.Module._load (module.js : 439 : 3)의 에서 Module.load (module.js : 488 : 32) tryModuleLoad (module.js : 447 : 12) at Module.require 4935 : 17) at 요구 사항 (internal/module.js : 20 : 19) at file : /// H : /electric/views/login.html : 2 : 3 –