electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.49k stars 518 forks source link

Squirrel maker error: cannot find app.asar #473

Closed DustFinger001 closed 6 years ago

DustFinger001 commented 6 years ago

Please describe your issue: when i exec 'electron-forge make' , there is an Error occurred
Making for target: squirrel - On platform: win32 - For arch: x64 electron-windows-installer:fs-utils Error: ENOENT: no such file or directory, stat 'D:\cloud_tunnel\cloud-tunnel\out\app-win32-x64\resources\app.asar'

And i found that this 'app.asar' file must be the 'electron.asar' file in same directory. error

what can i do for it? please help.

*Console output when you run electron-forge with the environment variable `DEBUG=electron-forge:`. (Instructions on how to do so here). Please include the stack trace if one exists.**

D:\cloud_tunnel\cloud-tunnel>electron-forge make --skip-package
√ Checking your system
√ Resolving Forge Config
WARNING: Skipping the packaging step, this could result in an out of date build
Making for the following targets:
- Making for target: squirrel - On platform: win32 - For arch: x64  electron-windows-installer:fs-utils Error: ENOENT: no such file or directory, stat 'D:\cloud_tunnel\cloud-tunnel\out\app-win32-x64\resources\app.asar' +0ms
  electron-windows-installer:main Created NuSpec file:
  electron-windows-installer:main <?xml version="1.0" encoding="utf-8"?>
  electron-windows-installer:main <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  electron-windows-installer:main   <metadata>
  electron-windows-installer:main     <id>sshtunnel</id>
  electron-windows-installer:main     <title>sshtunnel</title>
  electron-windows-installer:main     <version>1.0.0</version>
  electron-windows-installer:main     <authors>tangchuntao</authors>
  electron-windows-installer:main     <owners>tangchuntao</owners>
  electron-windows-installer:main     <iconUrl>https://raw.githubusercontent.com/atom/electron/master/atom/browser/resources/win/atom.ico</iconUrl>
  electron-windows-installer:main     <requireLicenseAcceptance>false</requireLicenseAcceptance>
  electron-windows-installer:main     <description>My Electron application description</description>
  electron-windows-installer:main     <copyright>Copyright © 2018 tangchuntao</copyright>
  electron-windows-installer:main   </metadata>
  electron-windows-installer:main   <files>
  electron-windows-installer:main     <file src="locales\**" target="lib\net45\locales" />
  electron-windows-installer:main     <file src="resources\**" target="lib\net45\resources" />
  electron-windows-installer:main     <file src="*.bin" target="lib\net45" />
  electron-windows-installer:main     <file src="*.dll" target="lib\net45" />
  electron-windows-installer:main     <file src="*.pak" target="lib\net45" />
  electron-windows-installer:main     <file src="Update.exe" target="lib\net45\squirrel.exe" />
  electron-windows-installer:main     <file src="icudtl.dat" target="lib\net45\icudtl.dat" />
  electron-windows-installer:main     <file src="LICENSE" target="lib\net45\LICENSE" />
  electron-windows-installer:main     <file src="app.exe" target="lib\net45\app.exe" />
  electron-windows-installer:main   </files>
  electron-windows-installer:main </package>
  electron-windows-installer:main  +4ms
  electron-windows-installer:spawn Spawning C:\Users\Administrator\AppData\Roaming\npm\node_modules\electron-forge\node_modules\_electron-winstaller@2.6.4@electron-winstaller\vendor\nuget.exe pack C:\Users\ADMINI~1\AppData\Local\Temp\si-118310-5332-akk93z.xjcct\sshtunnel.nuspec -BasePath D:\cloud_tunnel\cloud-tunnel\out\app-win32-x64 -OutputDirectory C:\Users\ADMINI~1\AppData\Local\Temp\si-118310-5332-akk93z.xjcct -NoDefaultExcludes +23ms
× Making for target: squirrel - On platform: win32 - For arch: x64

An unhandled error has occurred inside Forge:
An error occured while making for target: squirrel
Failed with exit code: 2148734720
Output:

Error: Failed with exit code: 2148734720
Output:

    at ChildProcess.proc.on.code (C:\Users\Administrator\AppData\Roaming\npm\node_modules\electron-forge\node_modules\_electron-winstaller@2.6.4@electron-winstaller\lib\spawn-promise.js:62:16)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:121:20)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:567:12)

What command line arguments are you passing?

electron-forge make

What does your config.forge data in package.json look like?

{
  "name": "sshtunnel",
  "productName": "sshtunnel",
  "version": "1.0.0",
  "description": "My Electron application description",
  "main": "src/main.js",
  "scripts": {
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "publish": "electron-forge publish",
    "lint": "eslint src --color"
  },
  "keywords": [],
  "author": "tangchuntao",
  "license": "MIT",
  "config": {
    "forge": {
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "dmg"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {
        "name": "sshtunnel",
        "packageManager": "yarn"
      },
      "electronWinstallerConfig": {
        "name": "sshtunnel"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "sshtunnel"
      }
    }
  },
  "dependencies": {
    "electron-compile": "^6.4.2",
    "electron-squirrel-startup": "^1.0.0",
    "portfinder": "^1.0.13",
    "tree-kill": "^1.2.0",
    "uuid": "^3.2.1"
  },
  "devDependencies": {
    "babel-plugin-transform-async-to-generator": "^6.24.1",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react": "^6.24.1",
    "electron-forge": "^5.1.1",
    "electron-prebuilt-compile": "1.8.4",
    "eslint": "^3",
    "eslint-config-airbnb": "^15",
    "eslint-plugin-import": "^2",
    "eslint-plugin-jsx-a11y": "^5",
    "eslint-plugin-react": "^7"
  }
}
malept commented 6 years ago

This seems specific to electron-winstaller to me, and not to Electron Forge. Although, the only thing I can find related to that in its issue tracker is https://github.com/electron/windows-installer/issues/220. @MarshallOfSound do you have any ideas?

MarshallOfSound commented 6 years ago

This issue is something going wrong in Squirrel.Windows. The app.asar log is unrelated (it logs that error but has a fallback, that log is for debugging purposes)