2
votes

I have build a simple app using electron and its works fine when you launch with npm start. After i am try to deploy my application, I am getting following error.

WARNING: --asar does not take any arguments, it only has sub-properties (see --help) Packaging app for platform win32 ia32 using electron v4.1.3 WARNING: Found 'electron' but not as a devDependency, pruning anyway rcedit.exe failed with exit code 1. Reserved header is not 0 or image type is not icon for 'a' Fatal error: Unable to set icon npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] package-win: electron-packager . electron-tutorial-app --overwrite --asar=true --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="ShoppingList" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] package-win script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

I already tried npm cache clean --force and install node modules again by npm install did't worked in my case. can anyone help me with this please?

package.json

{
  "name": "shoppinglist",
  "version": "1.0.0",
  "description": "Electron shoppinglist desktop app",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=assets/icons/mac/icon.icns --prune=true --out=release-builds",
    "package-win": "electron-packager . --overwrite --asar=true --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Shopping List\"",
    "package-linux" : "electron-packager . --overwrite --platform=linux --arch=x64 --icon=assets/icons/png/icon.png --prune=true --out=release-builds"
  },
  "license": "ISC",
  "dependencies": {
    "electron": "^1.7.6"
  },
  "devDependencies": {
    "electron-packager": "^9.0.1"
  }
}
2
Your production name is different from package.json when compare with error message.. - Aravinda Meewalaarachchi
yes...i just change the names frequently..because i thought it might be the spaces between the application name. - Steave Jones

2 Answers

3
votes

This can be happen for some reason your cache gets corrupted with some conflicting versions of different dependencies but in your case, you have already run npm cache clean and reinstalled all the node modules.

Please check folder paths that you have given to the package.json. This might fix your problem.

3
votes

I have also faced this kind of problem. I have move the electron dependency from dependencies to devDependencies in order to solve the problem.It works for me.