我想用电子运行Express(带有Echma6)
我最近尝试了本教程,并且运行顺利 https://github.com/frankhale/electron-with-express 但是当我尝试将Express与ECMA 6代码一起使用时,出现以下问题
E:\ testElectron \ express-express \ express-app \ src \ index.js:1 (函数(导出,需求,模块,__ filename,__ dirname){从'express'导入express; ^^^^^^^^
SyntaxError:意外标识符
当我分别运行我的快速代码时,它运行正常
const {
ipcRenderer
} = require('electron'),
expressAppUrl = "http://127.0.0.1:3000",
spawn = require("child_process").spawn,
// For electron-packager change cwd in spawn to app.getAppPath() and
// uncomment the app require below
//app = require('electron').remote.app,
node = spawn(".\\node.exe", ["./express-app/bin/www"], {
cwd: process.cwd()
}),
我想从电子中产生表达(带有echma 6)