Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

electron packager returns an error - command failed npm prune --production

My electron packager return an error:

Typed command:

electron-packager ./packager angular-test --platform=win32 --arch=ia32

The error:

Packaging app for platform win32 ia32 using electron v1.4.13
Command failed: npm prune --production
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "prune" "--production"
npm ERR! node v6.2.2
npm ERR! npm  v3.9.5
npm ERR! path C:\Users\dell\AppData\Local\Temp\electron-packager\win32-ia32\angular-test-win32-ia32\resources\app\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\dell\AppData\Local\Temp\electron-packager\win32-ia32\angular-test-win32-ia32\resources\app\package.json'
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\dell\AppData\Local\Temp\electron-packager\win32-ia32\angular-test-win32-ia32\resources\app\package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\dell\AppData\Local\Temp\electron-packager\win32-ia32\angular-test-win32-ia32\resources\app\npm-debug.log

Does anybody have an idea about what is wrong?

like image 254
Jay Avatar asked Dec 31 '16 19:12

Jay


1 Answers

You need to have a package.json file in your ./packager directory. This is a required file for Electron-packager to be able to package your app. An example package.json file can be found here or for quick reference:

{
  "name"    : "your-app",
  "version" : "0.1.0",
  "main"    : "main.js"
}
like image 151
Ben Kennedy Avatar answered Nov 15 '22 07:11

Ben Kennedy