Electron NSIS build fails


#1

Electron 1.6.11
Node 6.11.0
using electron-builder 19.45.4 on WIndows 7

NSIS build fails with error, can’t resolve extract-zip module

build

electron-builder 19.45.4
No native production dependencies
Packaging for win32 x64 using electron 1.6.11 to dist\win-unpacked
Error: Unresolved node modules: extract-zip

even though extract-zip installed successfully.

package.json file:

{
“name”: “myapp”,
“version”: “1.0.0”,
“description”: “myapp”,
“author”: “myapp”,
“license”: “MIT”,
“main”: “index.js”,
“build”: {
“appId”: “myapp”,
“productName”: “myapp”,
“win”: {
“target”: [
“nsis”
],
“icon”: “icons/ico/myapp.ico”
},
“nsis”: {
“installerIcon”: “icons/ico/myapp.ico”,
“uninstallerIcon”: “icons/ico/myapp.ico”,
“license”: “LICENSE”,
“runAfterFinish”: true
}
},
“scripts”: {
“pack”: “build --dir”,
“dist”: “build”,
“postinstall”: “install-app-deps”,
“electron”: “electron .”
},
“devDependencies”: {
“electron”: “^1.6.11”,
“electron-builder”: “^19.45.4”,
“bluebird”: “^3.5.1”,
“extract-zip”: “^1.6.6”,
“fluent-ffmpeg”: “^2.1.2”,
“fs”: “0.0.1-security”,
“jquery”: “^3.2.1”,
“string-search”: “^1.2.0”,
“sybase”: “^1.2.1”
}
}


#2

Prior to running:

C:\Users\you> npm run dist

Set environment variable as below:

C:\Users\you> set ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true

The error is still reported as : ?? Unresolved node modules: extract-zip
but installer builds and works.