Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Electron app symlink error #956

Closed
Jflinchum opened this issue Dec 1, 2016 · 8 comments
Closed

Building Electron app symlink error #956

Jflinchum opened this issue Dec 1, 2016 · 8 comments

Comments

@Jflinchum
Copy link

Jflinchum commented Dec 1, 2016

  • Version: 10.3.0
  • Target: macOS

When trying to run build --mac for my Electron app, I get this error:

yarn run v0.17.9
$ build --mac
Skip app dependencies rebuild because npmRebuild is set to false
⚠️  Packaging using asar archive is disabled — it is strongly not recommended.
Please enable asar and use asarUnpack to unpack files that must be externally available.
Packaging for darwin x64 using electron 1.4.7 to dist/mac
Error: ENOENT: no such file or directory, symlink 'Versions/Current/Electron Framework' -> '/Users/jflinchum/Documents/myApp/dist/mac/Electron.app/Contents/Resources/app/node_modules/electron-prebuilt/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Electron Framework'
    at Error (native)
From previous event:
    at /Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/util/fs.ts:178:13
    at next (native)
From previous event:
    at walk (/Users/jflinchum/Documents/myApp/node_modules/electron-builder/out/util/fs.js:236:26)
    at /Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/util/fs.ts:74:44
    at /Users/jflinchum/Documents/myApp/node_modules/graceful-fs/polyfills.js:279:18
    at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
    at /Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/util/fs.ts:62:10
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
    at /Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/util/fs.ts:59:27
    at next (native)
    at go$readdir$cb (/Users/jflinchum/Documents/myApp/node_modules/graceful-fs/graceful-fs.js:149:14)
    at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
    at walk (/Users/jflinchum/Documents/myApp/node_modules/electron-builder/out/util/fs.js:90:22)
    at copyDir (/Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/util/fs.ts:176:3)
    at /Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/platformPackager.ts:250:17
From previous event:
    at MacPackager.doPack (/Users/jflinchum/Documents/myApp/node_modules/electron-builder/out/platformPackager.js:321:11)
    at /Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/macPackager.ts:78:28
    at next (native)
From previous event:
    at MacPackager.pack (/Users/jflinchum/Documents/myApp/node_modules/electron-builder/out/macPackager.js:162:11)
    at /Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/packager.ts:132:22
From previous event:
    at Packager.doBuild (/Users/jflinchum/Documents/myApp/node_modules/electron-builder/out/packager.js:260:11)
    at /Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/packager.ts:100:38
    at next (native)
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
    at Packager.build (/Users/jflinchum/Documents/myApp/node_modules/electron-builder/out/packager.js:212:11)
    at /Users/jflinchum/Documents/myApp/node_modules/electron-builder/src/builder.ts:241:40
    at next (native)
From previous event:
    at build (/Users/jflinchum/Documents/myApp/node_modules/electron-builder/out/builder.js:89:21)
    at Object.<anonymous> (/Users/jflinchum/Documents/myApp/node_modules/electron-builder/out/cli/build-cli.js:68:41)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

When I downgrade to 10.0.0, I don't seem to encounter the issue.
Node version: 6.6.0
Electron version: 1.4.7

@SxMShaDoW
Copy link

You may want to include a "scrubbed version" of your package.json for the build settings

@Jflinchum
Copy link
Author

package.json build settings:

"build": {
    "appId": "",
    "asar": false,
    "category": "",
    "npmRebuild": false,
    "win": {
      "target": "nsis",
      "iconUrl": ""
    },
    "nsis": {
      "guid": "",
      "oneClick": true,
      "warningsAsErrors": false,
      "perMachine": true
    },
    "publish": {
      "provider": "generic",
      "url": ""
    }
}

@develar
Copy link
Member

develar commented Dec 1, 2016

electron-prebuilt must be not in your app dependencies.

@develar
Copy link
Member

develar commented Dec 1, 2016

I don't see any problems in the code. Since you must not include electron-prebuilt as production dependency, I am not going to investigate why symlinks failed.

Or, maybe problem that electron-builder incorrectly not filtered out electron-prebuilt even if it is in the dev dependency — please check it. Also, please attach debug log: set env DEBUG=electron-builder

@Jflinchum
Copy link
Author

Here is the debug log. We don't include electron-prebuilt as an app dependency.

@develar
Copy link
Member

develar commented Dec 2, 2016

@Jflinchum Please

  • provide output of npm ls
  • search string electron-prebuilt in your project.
  • provide output of find . -name electron-prebuilt

@Jflinchum
Copy link
Author

Jflinchum commented Dec 2, 2016

I believe I found the issue. We don't have electron-prebuilt as a dependency, but we have electron-rebuild as a dependency, which depends on electron-prebuilt. When I remove electron-rebuild, it builds successfully.

@develar
Copy link
Member

develar commented Dec 2, 2016

You must not use electron-rebuild at all. If electron-builder cannot build native deps for you properly — please file issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants