electron-packager .
not installing all modules from node_modules
on Darwin platform.
When trying to start such packaged app, following error occurs:
Uncaught Exception:
Error: Cannot find module 'sudo-prompt'
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename
Both package.json
and node_modules
are in current folder.
I’ve tried to remove node_modules
completely and refresh them with npm install -production
but it didn't help to package the app correctly.
package.json
"main": "app.js",
"scripts": {
"start": "electron ."
},
"devDependencies": {
"chokidar": "^1.7.0",
"electron": "^1.6.11",
"filesize": "^3.5.6",
"jquery": "^3.2.1",
"keymaster": "^1.6.2",
"open": "0.0.5",
"peity": "^3.2.1",
"sudo-prompt": "^7.1.0",
"underscore": "^1.8.3",
"unzip-stream": "^0.1.2"
},
"dependencies": {
"chart.js": "^2.6.0",
"filesize": "^3.5.10",
"open": "0.0.5",
"sudo-prompt": "^7.1.0"
}
Packaged app with electron-packager
has only chart.js
All other dependencies are missing.
.app/Contents/Resources/app $ npm ls
└─┬ chart.js@2.6.0
├─┬ chartjs-color@2.1.0
│ ├─┬ chartjs-color-string@0.4.0
│ │ └── color-name@1.1.2
│ └── color-convert@0.5.3
└── moment@2.18.1