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

Error: ENOENT: no such file or directory, scandir '[project]/node_modules/auto-launch/node_modules/applescript' #92

Open
kxxt opened this issue Sep 12, 2023 · 5 comments

Comments

@kxxt
Copy link
Contributor

kxxt commented Sep 12, 2023

Hi,

Thanks for maintaining this project.

I am using the latest app-builder built from the master branch. I encountered the following error when building element-desktop on both x64 and riscv64 architectures:

yarn run v1.22.19
$ yarn run build:ts && yarn run build:res && electron-builder
$ tsc
$ ts-node scripts/copy-res.ts
  • electron-builder  version=24.6.4 os=6.1.52-1-lts
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  • packaging       platform=linux arch=x64 electron=26.2.0 appOutDir=dist/linux-unpacked
  ⨯ ENOENT: no such file or directory, scandir '/home/kxxt/Workspaces/arch-riscv/repos/element-desktop/node_modules/auto-launch/node_modules/applescript'  failedTask=build stackTrace=Error: ENOENT: no such file or directory, scandir '/home/kxxt/Workspaces/arch-riscv/repos/element-desktop/node_modules/auto-launch/node_modules/applescript'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

In this case, applescript is located in [project-dir]/node_modules instead of [project-dir]/node_modules/auto-launch/node_modules.

Everything works fine on commit c92c3a2 but it starts to fail on commit 6c7d1e1. So it suggests that this bug is caused by #89.

@miaulightouch
Copy link

miaulightouch commented Sep 13, 2023

If a package (such as applescript) contains CLI binaries, Yarn/PNPM would symlink applescript to [project-dir]/node_modules/auto-launch/node_modules instead, not [project-dir]/node_modules

and yes, it caused by #89.

@miaulightouch
Copy link

@rxliuli, could you please take a look at this issue? It could cause the same problem if electron-updater is listed in the dependencies.

@rxliuli
Copy link
Contributor

rxliuli commented Sep 14, 2023

@rxliuli, could you please take a look at this issue? It could cause the same problem if electron-updater is listed in the dependencies.

I'll check this out later and see how bundle tools like esbuild resolve dependency conflicts

@mmaietta
Copy link
Collaborator

mmaietta commented Feb 14, 2024

Running into this issue with electron-builder unit tests when trying to upgrade to 4.2.0
electron-userland/electron-builder#7774

  ● posix smart unpack

    ENOENT: no such file or directory, scandir '/tmp/et-db411cd21f3bbd882f3a5a30c58db6ff/t-2ACDjf/test-project-9/node_modules/are-we-there-yet/node_modules/core-util-is'

Easy way to reproduce the same error (with significantly smaller dependency tree) is running electron-builder test case

TEST_FILES=HoistedNodeModuleTest pnpm run test-linux  

I believe this PR introduced the issue #89

Could someone please assist?

@fabienr
Copy link
Contributor

fabienr commented Feb 21, 2024

Run into a similar problem due to npm hoisted module. Please see (#105).

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

No branches or pull requests

5 participants