Process not defined while nodeIntegration is set

my index.js file for electron application

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

function createWindow () {
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: true



app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {

app.on('activate', () => {
  if (BrowserWindow.getAllWindows().length === 0) {

Index.html file

<!DOCTYPE html>
    <meta charset="UTF-8">
    <title>Hello World!</title>
    <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<body style="background: white;">
    <h1>Hello World!</h1>
        We are using node <script>document.write(process.versions.node)</script>,
        Chrome <script>document.write(</script>,
        and Electron <script>document.write(process.versions.electron)</script>.

the error i am getting in console

Uncaught ReferenceError: process is not defined
    at index.html:11

2 thoughts on “Process not defined while nodeIntegration is set

  1. In latest commit 186301e isolation has been enabled by defualt. That change broke tutorial in official docs. In webPreferences you should disable context isolation to make node integration working again.
    webPreferences: { nodeIntegration: true, contextIsolation: false }
    It’s temporary fix, we should wait for official announcement.