question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: Unexpected string when running electron-builder install-app-deps with yarn@berry

See original GitHub issue
  • Version: 22.7.0
  • Electron Version: 8.2.5
  • Electron Type (current, beta, nightly): current
  • Target: default target

I tried to integrate yarn2 (yarn@berry). Our repo contains an Electron App with sqlite3 as a dependency, that get “built” by node-pre-gyp when building the app. Whenn electron-builder tries to rebuild the native dependencies, the following error is thrown:

    • electron-builder  version=22.7.0
    • rebuilding native dependencies  dependencies=sqlite3@4.2.0 platform=linux arch=x64
    • rebuilding native dependency  name=sqlite3 version=4.2.0
    ⨯ cannot execute  cause=exit status 1
                    errorOut=/tmp/tmp-2426rUi2pP55zel/yarn:2
    exec "/usr/local/bin/node" '/project/electron-builder-yarn2/node_modules/yarn/bin/yarn.js' "$@"
             ^^^^^^^^^^^^^^^^^^^^^

    SyntaxError: Unexpected string
        at wrapSafe (internal/modules/cjs/loader.js:1047:16)
        at Module._compile (internal/modules/cjs/loader.js:1097:27)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
        at Module.load (internal/modules/cjs/loader.js:977:32)
        at Function.Module._load (internal/modules/cjs/loader.js:877:14)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
        at internal/main/run_main_module.js:18:47

                    command=/tmp/tmp-2426rUi2pP55zel/node /tmp/tmp-2426rUi2pP55zel/yarn run install
                    workingDir=/project/electron-builder-yarn2/node_modules/sqlite3

A minimal Reproduction can be found here: https://github.com/Thomb89/electron-builder-yarn2

This error can be reproduced in the docker image (i used electronuserland/builder:wine) with the following steps:

While yarn@berry is still not released (current version is 2.0.0-rc.27), will it be fully supported in the future?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:13

github_iconTop GitHub Comments

1reaction
fresholliecommented, Jan 4, 2021

I’m still experiencing this, worth keeping open

exec "/path/to/.nvm/versions/node/v12.19.1/bin/node" '/path/to/repo/.yarn/releases/yarn-berry.cjs' "$@"
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    SyntaxError: Unexpected string
        at wrapSafe (internal/modules/cjs/loader.js:931:16)
        at Module._compile (internal/modules/cjs/loader.js:979:27)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
        at Module.load (internal/modules/cjs/loader.js:879:32)
        at Function.Module._load (internal/modules/cjs/loader.js:724:14)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
        at internal/main/run_main_module.js:17:47
    
0reactions
Matthew-McRavencommented, Jan 25, 2022

I just saw this today, yarn 3.1.1, electron-builder 22.10.5.

nodeLinker is node-modules.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token '?' when creating new app using electron ...
SyntaxError : Unexpected token '? ... I had trying to create a new app with the new electron forge version 6, and I...
Read more >
Error Codes | Yarn - Package Manager
A file from the cache has been detected unused while installing dependencies. Running yarn cache clean will cause Yarn to remove everything inside...
Read more >
Untitled
Types of male speaking voices, Longest running tv series supernatural? G-force formula physics. Bo diddley song, Parker gold pen and pencil set, ...
Read more >
Error when running cleanbuild - Snapcraft forum
stage-packages , after , build , install , and prime are now under apps/fastmail which is wrong. They belong under parts/electron-app .
Read more >
Untitled
#Therapeia Copy on first write, Hanamint st moritz collection, Praxis vogtmann buckenhof, Add your logo to lightroom, Mulan chinese in muncy pa, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found