电子冻结时,需要[医]触角在index.html和一个进程称为电子助手占100%的cpu。
我在macOS 10.14.2上遇到了这个问题,但是我的一个朋友在Windows10上进行了测试,这起了作用。
来自package.json
"devDependencies": {
"electron": "^4.0.4"
},
"dependencies": {
"node-opcua": "^0.5.6"
}Main.js
const { app, BrowserWindow } = require('electron')
function createWindow () {
// Create the browser window.
win = new BrowserWindow({ width: 800, height: 600 })
// and load the index.html of the app.
win.loadFile('index.html')
win.webContents.openDevTools()
}
app.on('ready', createWindow)Index.html
<script>
// Does not work
const opcua = require('node-opcua')
console.log(opcua)
// Works
// const fs = require('fs')
// console.log(fs)
</script>当运行简单的代码时,它应该只在控制台中打印opcua对象。但整个选举破裂的过程冻结了。
发布于 2019-10-07 06:50:01
通过将节点opcua更新到2.1.9,电子更新到6.0.11来解决这个问题。
https://stackoverflow.com/questions/54516256
复制相似问题