'Electron.js NSIS installer - "oneClick": false has no effect. Keeps building one click installers

I want to make a Windows installer with electron.js, I referred to nsis config

I have set "oneClick": false

However, whenever I build the app with: npm run build

The option always shows as oneClick=true on build.

Have also tried npm run build-installer, to no avail. Same one click output :-(

I dont understand why is wouldnt accept the oneClick option, it had worked before, now I cant figure out why it just stopped working.

enter image description here

Here is an excerpt from package.json

"scripts": {
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "publish": "electron-forge publish",
    "lint": "echo \"No linting configured\"",
    "build-installer": "electron-builder",
    "build": "electron-builder"
  },
  
  "build": {
    "appId": "apppppppp",
    "win": {
      "target": [
        {
          "target": "nsis",
          "arch": [
            "x64"
          ]
        }
      ],
      "icon": "/src/images/icons/manifest-icon-512.maskable.png"
    }
  },
  "nsis": {
    "oneClick": false,
    "perMachine": false,
    "allowElevation": true,
    "allowToChangeInstallationDirectory": true
  },
  "dependencies": {},
  "devDependencies": {
    "@electron-forge/cli": "^6.0.0-beta.63",
    "@electron-forge/maker-deb": "^6.0.0-beta.63",
    "@electron-forge/maker-rpm": "^6.0.0-beta.63",
    "@electron-forge/maker-squirrel": "^6.0.0-beta.63",
    "@electron-forge/maker-zip": "^6.0.0-beta.63",
    "electron": "16.0.7",
    "build-installer": "electron-builder",
    "build": "electron-builder"
  }
}


Solution 1:[1]

I put the "nsis" options inside the "build" options and it worked.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mellow Monk