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

Electron error when building for Aarch64 on Raspberry Pi #4135

Closed
vegerot opened this issue Jan 4, 2020 · 8 comments · Fixed by #5329
Closed

Electron error when building for Aarch64 on Raspberry Pi #4135

vegerot opened this issue Jan 4, 2020 · 8 comments · Fixed by #5329
Labels
🤯 Type: Compatibility Issue contains information about a compatibility issue in Hyper

Comments

@vegerot
Copy link

vegerot commented Jan 4, 2020

  • [x ] I am on the latest Hyper.app version

  • [ x] I have searched the issues of this repo and believe that this is not a duplicate

  • Raspbian 10 (buster) (64-bit mode):

  • Canary:

Issue

I am trying to get Hyper working on the Raspberry Pi. This is a feature people have been asking for for years now. Trying to run yarn run app gives the error

yarn run v1.21.1
$ electron target
/home/pi/Downloads/hyper/node_modules/electron/index.js:14
    throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
    ^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
    at getElectronPath (/home/pi/Downloads/hyper/node_modules/electron/index.js:14:11)
    at Object.<anonymous> (/home/pi/Downloads/hyper/node_modules/electron/index.js:18:18)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
    at Module.load (internal/modules/cjs/loader.js:988:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/pi/Downloads/hyper/node_modules/electron/cli.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Specifically,
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again

I have attempted to do this—many times�—to no avail. Even though I can get electron installed independently with npm install -g electron@6

Edit: I think I was able to fix the first error by replacing electron 7.1 with 6.1.7. But now I get his error when compiling for distribution

yarn run v1.21.1
$ yarn run build && cross-env BABEL_ENV=production babel target/renderer/bundle.js --out-file target/renderer/bundle.js --no-comments --minified && electron-builder
$ cross-env NODE_ENV=production webpack && tsc -b -v
Hash: c196eb9a25da369b3694df793668c7444c664b7929de4f24bb2a654bc239
Version: webpack 4.41.5
Child hyper-app:
    Hash: c196eb9a25da369b3694
    Time: 4667ms
    Built at: 01/03/2020 9:20:58 PM
                   Asset       Size  Chunks             Chunk Names
          ignore_this.js   3.57 KiB       0  [emitted]  main
              index.html  836 bytes          [emitted]  
     keymaps/darwin.json   1.57 KiB          [emitted]  
      keymaps/linux.json   1.49 KiB          [emitted]  
      keymaps/win32.json   1.32 KiB          [emitted]  
             notify.html  144 bytes          [emitted]  
            package.json  964 bytes          [emitted]  
         static/icon.png   4.78 KiB          [emitted]  
    static/icon96x96.png   5.72 KiB          [emitted]  
           tsconfig.json  196 bytes          [emitted]  
    Entrypoint main = ignore_this.js
    [0] ./app/index.ts 0 bytes {0} [built]
Child hyper:
    Hash: df793668c7444c664b79
    Time: 14613ms
    Built at: 01/03/2020 9:21:08 PM
               Asset      Size  Chunks                   Chunk Names
    assets/icons.svg  3.26 KiB          [emitted]        
           bundle.js  2.12 MiB       0  [emitted]        main
       bundle.js.map   2.6 MiB       0  [emitted] [dev]  main
    Entrypoint main = bundle.js bundle.js.map
      [0] ./lib/index.tsx 6.07 KiB {0} [built]
      [1] external "electron" 42 bytes {0} [built]
     [46] ./lib/rpc.ts 56 bytes {0} [built]
     [49] ./lib/actions/index.ts 214 bytes {0} [built]
     [51] ./lib/utils/config.ts 473 bytes {0} [built]
     [52] ./lib/utils/plugins.ts 11.3 KiB {0} [built]
     [62] ./lib/utils/file.ts 794 bytes {0} [built]
     [64] ./lib/actions/ui.ts 6.64 KiB {0} [built]
     [69] ./lib/actions/sessions.ts 3.41 KiB {0} [built]
     [73] ./lib/actions/term-groups.ts 4.18 KiB {0} [built]
     [82] ./lib/actions/updater.ts 403 bytes {0} [built]
     [84] ./lib/actions/notifications.ts 345 bytes {0} [built]
     [86] ./lib/actions/config.ts 279 bytes {0} [built]
     [88] ./lib/containers/hyper.tsx 4.1 KiB {0} [built]
    [226] ./lib/store/configure-store.ts 258 bytes {0} [built]
        + 228 hidden modules
Child hyper-cli:
    Hash: 29de4f24bb2a654bc239
    Time: 12776ms
    Built at: 01/03/2020 9:21:06 PM
     Asset      Size  Chunks             Chunk Names
    cli.js  1.09 MiB       0  [emitted]  main
    Entrypoint main = cli.js
      [0] ./cli/index.ts 4.73 KiB {0} [built]
      [1] external "child_process" 42 bytes {0} [built]
      [2] external "path" 42 bytes {0} [built]
      [3] external "fs" 42 bytes {0} [built]
      [4] ./app/package.json 964 bytes {0} [built]
     [10] (webpack)/buildin/module.js 497 bytes {0} [built]
     [16] external "os" 42 bytes {0} [built]
     [31] ./node_modules/args/lib sync 160 bytes {0} [built]
     [39] external "tty" 42 bytes {0} [built]
     [44] external "util" 42 bytes {0} [built]
     [58] external "events" 42 bytes {0} [built]
     [65] external "stream" 42 bytes {0} [built]
     [81] external "http" 42 bytes {0} [built]
    [112] external "readline" 42 bytes {0} [built]
    [130] ./cli/api.ts 3.9 KiB {0} [built]
        + 168 hidden modules
    
    WARNING in ./node_modules/args/lib/version.js 18:11-24
    Critical dependency: the request of a dependency is an expression
     @ ./node_modules/args/lib/index.js
     @ ./cli/index.ts
    
    WARNING in ./node_modules/keyv/src/index.js 18:14-40
    Critical dependency: the request of a dependency is an expression
     @ ./node_modules/cacheable-lookup/index.js
     @ ./node_modules/got/dist/source/normalize-arguments.js
     @ ./node_modules/got/dist/source/create.js
     @ ./node_modules/got/dist/source/index.js
     @ ./cli/index.ts
9:21:09 PM - Projects in this build: 
    * app/tsconfig.json
    * tsconfig.json

9:21:09 PM - Project 'app/tsconfig.json' is up to date because newest input 'app/updater.js' is older than oldest output 'target/auto-updater-linux.js'

9:21:09 PM - Project 'tsconfig.json' is out of date because output file 'dist/tmp/root/app/config.js' does not exist

9:21:09 PM - Building project '/home/pi/Downloads/hyper/tsconfig.json'...

9:21:16 PM - Updating unchanged output timestamps of project '/home/pi/Downloads/hyper/tsconfig.json'...

  • electron-builder  version=22.2.0 os=4.19.80-v8+
  • loaded configuration  file=/home/pi/Downloads/hyper/electron-builder.json
  • rebuilding native dependencies  dependencies=node-pty@0.9.0 platform=linux arch=x64
  • rebuilding native dependency  name=node-pty version=0.9.0
  ⨯ cannot execute  cause=exit status 1
                    out=$ node scripts/install.js
    make: Entering directory '/home/pi/Downloads/hyper/target/node_modules/node-pty/build'
      CXX(target) Release/obj.target/pty/src/unix/pty.o
    make: Leaving directory '/home/pi/Downloads/hyper/target/node_modules/node-pty/build'
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    
                    errorOut=gyp info it worked if it ends with ok
    gyp info using node-gyp@5.0.5
    gyp info using node@13.5.0 | linux | arm
    gyp info find Python using Python version 2.7.16 found at "/usr/bin/python"
    gyp info spawn /usr/bin/python
    gyp info spawn args [
    gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
    gyp info spawn args   'binding.gyp',
    gyp info spawn args   '-f',
    gyp info spawn args   'make',
    gyp info spawn args   '-I',
    gyp info spawn args   '/home/pi/Downloads/hyper/target/node_modules/node-pty/build/config.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/home/pi/.electron-gyp/6.1.7/include/node/common.gypi',
    gyp info spawn args   '-Dlibrary=shared_library',
    gyp info spawn args   '-Dvisibility=default',
    gyp info spawn args   '-Dnode_root_dir=/home/pi/.electron-gyp/6.1.7',
    gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
    gyp info spawn args   '-Dnode_lib_file=/home/pi/.electron-gyp/6.1.7/<(target_arch)/node.lib',
    gyp info spawn args   '-Dmodule_root_dir=/home/pi/Downloads/hyper/target/node_modules/node-pty',
    gyp info spawn args   '-Dnode_engine=v8',
    gyp info spawn args   '--depth=.',
    gyp info spawn args   '--no-parallel',
    gyp info spawn args   '--generator-output',
    gyp info spawn args   'build',
    gyp info spawn args   '-Goutput_dir=.'
    gyp info spawn args ]
    gyp info spawn make
    gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    g++: error: unrecognized command line option ‘-m64’
    make: *** [pty.target.mk:107: Release/obj.target/pty/src/unix/pty.o] Error 1
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:305:20)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    gyp ERR! System Linux 4.19.80-v8+
    gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/pi/Downloads/hyper/target/node_modules/node-pty
    gyp ERR! node -v v13.5.0
    gyp ERR! node-gyp -v v5.0.5
    gyp ERR! not ok 
    error Command failed with exit code 1.
    
                    command=/usr/bin/node /usr/share/yarn/bin/yarn.js run install
                    workingDir=/home/pi/Downloads/hyper/target/node_modules/node-pty
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I get this error when trying to yarn run app:

yarn run v1.21.1                                                                                                                 [0/814]
$ electron target
innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /home/pi/Downloads/hyper/target/node_modules/node-pty/lib/unixTerminal.js
- /home/pi/Downloads/hyper/target/node_modules/node-pty/lib/index.js
- /home/pi/Downloads/hyper/target/session.js
- /home/pi/Downloads/hyper/target/ui/window.js
- /home/pi/Downloads/hyper/target/index.js
- /home/pi/Downloads/hyper/node_modules/electron/dist/resources/default_app.asar/main.js                                                -
    at Module._resolveFilename (internal/modules/cjs/loader.js:627:15)
    at Function.Module._resolveFilename (/home/pi/Downloads/hyper/node_modules/electron/dist/resources/electron.asar/common/reset-search
-paths.js:41:16)
    at Function.Module._load (internal/modules/cjs/loader.js:531:27)
    at Function._load (/home/pi/Downloads/hyper/target/plugins.js:79:37)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/home/pi/Downloads/hyper/target/node_modules/node-pty/lib/unixTerminal.js:30:15)
    at Module._compile (internal/modules/cjs/loader.js:786:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
    at Module.load (internal/modules/cjs/loader.js:645:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/pi/Downloads/hyper/target/node_modules/node-pty/lib/unixTerminal.js',
    '/home/pi/Downloads/hyper/target/node_modules/node-pty/lib/index.js',
    '/home/pi/Downloads/hyper/target/session.js',
    '/home/pi/Downloads/hyper/target/ui/window.js',
    '/home/pi/Downloads/hyper/target/index.js',
    '/home/pi/Downloads/hyper/node_modules/electron/dist/resources/default_app.asar/main.js',
    undefined
  ]
}
App threw an error during load
Error: `node-pty` failed to load. Typically this means that it was built incorrectly. Please check the `readme.md` to more info.
    at createNodePtyError (/home/pi/Downloads/hyper/target/session.js:19:34)
    at Object.<anonymous> (/home/pi/Downloads/hyper/target/session.js:25:11)
    at Module._compile (internal/modules/cjs/loader.js:786:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Function._load (/home/pi/Downloads/hyper/target/plugins.js:79:37)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/home/pi/Downloads/hyper/target/ui/window.js:18:35)
A JavaScript error occurred in the main process
Uncaught Exception:
Error: `node-pty` failed to load. Typically this means that it was built incorrectly. Please check the `readme.md` to more info.
    at createNodePtyError (/home/pi/Downloads/hyper/target/session.js:19:34)
    at Object.<anonymous> (/home/pi/Downloads/hyper/target/session.js:25:11)
    at Module._compile (internal/modules/cjs/loader.js:786:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
    at Module.load (internal/modules/cjs/loader.js:645:32)
    at Function.Module._load (internal/modules/cjs/loader.js:560:12)
    at Function._load (/home/pi/Downloads/hyper/target/plugins.js:79:37)
    at Module.require (internal/modules/cjs/loader.js:685:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/home/pi/Downloads/hyper/target/ui/window.js:18:35)

Me, and many other people, would love to have Hyper on ARM. I would appreciate all the help I can get in trying this

@ivanwonder
Copy link
Contributor

AFAIK, you failed to download electron 7.1. electron/electron#8466 (comment)

@vegerot
Copy link
Author

vegerot commented Jan 4, 2020

@ivanwonder Excuse the dumb question, but how do I download it correctly? I've spent hours trying to get it. With npm, yarn, apt, etc.

Obviously the first thing that I did was do yarn install to install all dependencies. This produced that first error you saw. Then I tried a bunch of other yarn ways of doing it. I tried manually installing it with yarn install electron, which producing the same error. I tried switching to npm, producing the same error. I found the link you shared last night, and did not find it helpful. It produces the same error, and didn't find the progress bar useful

I think the error actually comes from the post-installation phase. When cli.js checks for the existence of certain paths

@DonavanMartin
Copy link

Solved on raspberry Pi4 with:
npm i -D electron --arch=armv7l

@danacr
Copy link

danacr commented Sep 1, 2020

I had the same issue, so I spent some time fixing the arm64 build: https://github.com/danacr/hyper/releases/tag/v3.0.2-arm64-fpm-1.10.2

@vegerot
Copy link
Author

vegerot commented Sep 1, 2020

How'd you fix it? Awesome!!

@danacr
Copy link

danacr commented Sep 3, 2020

This is the diff: 3.0.2...danacr:3.0.2-build

Disregard the Dockerfile, I was using that for testing

@vegerot
Copy link
Author

vegerot commented Sep 4, 2020

Wow, great fixes! Why didn't I try that lol

@LabhanshAgrawal LabhanshAgrawal added the 🤯 Type: Compatibility Issue contains information about a compatibility issue in Hyper label Feb 9, 2021
@LabhanshAgrawal
Copy link
Collaborator

Can you try the build from here and tell if it's working for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤯 Type: Compatibility Issue contains information about a compatibility issue in Hyper
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants