Skip to content

No node modules found in collection #9423

@lyswhut

Description

@lyswhut

Electron-Builder Version:

26.3.4

Node Version:

22.20.0

Electron Version:

37.10.3

Electron Type:

current

Target:

Windows/MacOS/Linux

Debug Logs:

  • electron-builder  version=26.3.4 os=10.0.19045
  • effective config  config=directories:
  output: H:\any-listen\build
  buildResources: ./resources
appId: cn.toside.anylisten.desktop
productName: any-listen
extraMetadata:
  name: any-listen
  main: dist/electron/main.js
  description: A cross-platform private music playback service
  author:
    name: lyswhut
protocols:
  name: anylisten-protocol
  schemes:
    - anylisten
files:
  - filter:
      - dist/**/*
      - '!node_modules/**/*'
      - node_modules/font-list
  - from: node_modules/better-sqlite3/build/Release
    to: dist/electron/native
    filter:
      - better_sqlite3.node
asar:
  smartUnpack: false
extraResources:
  - filter:
      - ./licenses
publish:
  - provider: github
    owner: any-listen
    repo: any-listen-desktop
win:
  icon: ./resources/icons/icon.ico
  legalTrademarks: lyswhut
nsis:
  oneClick: false
  language: '2052'
  allowToChangeInstallationDirectory: true
  differentialPackage: true
  license: ./licenses/license.rtf
  shortcutName: Any Listen
linux:
  maintainer: lyswhut
  icon: ./resources/icons
  category: Utility;AudioVideo;Audio;Player;Music;
  desktop:
    entry:
      Name: Any Listen
      Name[zh_CN]: Any Listen
      Name[zh_TW]: Any Listen
      Encoding: UTF-8
      MimeType: x-scheme-handler/anylisten
      StartupNotify: 'false'
appImage:
  license: ./licenses/license_zh.txt
  category: Utility;AudioVideo;Audio;Player;Music;
mac:
  icon: ./resources/icons/icon.icns
  category: public.app-category.music
dmg:
  contents:
    - x: 130
      'y': 190
    - x: 410
      'y': 190
      type: link
      path: /Applications
  title: Any Listen v${version}

  • writing effective config  file=H:\any-listen\build\builder-effective-config.yaml
  • packageManager not detected by file, falling back to environment detection  resolvedPackageManager=pnpm detected=H:\any-listen\packages\desktop
  • spawning        command=pnpm --workspace-root exec pwd cwd=H:\any-listen\packages\desktop
  • exited          command=pnpm code=1 pid=10944 out=undefined
 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command "pwd" not found

  • checking for potential workspace root  path=H:\any-listen\packages\desktop
  • checking for potential workspace root  path=H:\any-listen\packages
  • checking for potential workspace root  path=H:\any-listen
  • detected workspace root for project using packageManager field  pm=pnpm config=pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a resolved=H:\any-listen projectDir=H:\any-listen\packages\desktop
  • executing @electron/rebuild  electronVersion=37.10.3 arch=x64 buildFromSource=false workspaceRoot=H:\any-listen projectDir=./ appDir=./
  • installing native dependencies  arch=x64
  • preparing       moduleName=better-sqlite3 arch=x64
  • finished        moduleName=better-sqlite3 arch=x64
  • completed installing native dependencies
  • packaging       platform=win32 arch=x64 electron=37.10.3 appOutDir=H:\any-listen\build\win-unpacked
  • no custom electronDist provided, unpacking default Electron distribution
  • spawning        command=H:\any-listen\node_modules\.pnpm\app-builder-bin@5.0.0-alpha.12\node_modules\app-builder-bin\win\x64\app-builder.exe unpack-electron --configuration [{"platform":"win32","arch":"x64","version":"37.10.3"}] --output H:\any-listen\build\win-unpacked --distMacOsAppName Electron.app
  • map async       taskCount=2
  • map async       taskCount=1
  • map async       taskCount=75
  • exited          command=app-builder.exe code=0 pid=21764
  • no event listeners found  event=afterExtract
  • spawning node module collector process  command=cmd.exe args=["/c","C:\\Users\\user\\AppData\\Local\\Temp\\t-yrlEHU\\pnpm-1.bat","list","--prod","--json","--depth","Infinity","--long"] cwd=H:\any-listen\packages\desktop tempOutputFile=C:\Users\user\AppData\Local\Temp\t-yrlEHU\pnpm-0-output.json
  • Cannot find package.json for dependency  packageName=@any-listen/web path=H:\any-listen\packages\shared\web version=link:../shared/web
  • Cannot find package.json for dependency  packageName=desktop path=H:\any-listen\packages\desktop version=0.4.0-beta.3
  • node modules collection complete  packageName=any-listen depCount=0
  • no node modules found in collection, trying next search directory  searchDir=H:\any-listen\packages\desktop attempt=0
  • spawning node module collector process  command=cmd.exe args=["/c","C:\\Users\\user\\AppData\\Local\\Temp\\t-yrlEHU\\pnpm-3.bat","list","--prod","--json","--depth","Infinity","--long"] cwd=H:\any-listen tempOutputFile=C:\Users\user\AppData\Local\Temp\t-yrlEHU\pnpm-2-output.json
  • node modules collection complete  packageName=any-listen depCount=0
  • no node modules returned while searching directories  searchDirectories=["","H:\\any-listen"]
  • updating asar integrity executable resource  executablePath=H:\any-listen\build\win-unpacked\any-listen.exe
  • copying files using pattern  matcher=from: H:\any-listen\packages\desktop, to: H:\any-listen\build\win-unpacked\resources, patterns: licenses
  • copying         src=H:\any-listen\packages\desktop destination=H:\any-listen\build\win-unpacked\resources
  • spawning        command=H:\any-listen\node_modules\.pnpm\app-builder-bin@5.0.0-alpha.12\node_modules\app-builder-bin\win\x64\app-builder.exe icon --format ico --root H:\any-listen\packages\desktop\resources --root H:\any-listen\packages\desktop --out H:\any-listen\build\.icon-ico --input ./resources/icons/icon.ico
  • path doesn't exist  path=H:\any-listen\packages\desktop\resources\resources\icons\icon.ico
  • path resolved   path=H:\any-listen\packages\desktop\resources\icons\icon.ico outputFormat=ico
  • exited          command=app-builder.exe code=0 pid=8636 out={"icons":[{"file":"H:\\any-listen\\packages\\desktop\\resources\\icons\\icon.ico","size":256}],"isFallback":false}
  • spawning        command=H:\any-listen\node_modules\.pnpm\app-builder-bin@5.0.0-alpha.12\node_modules\app-builder-bin\win\x64\app-builder.exe rcedit --args ["H:\\any-listen\\build\\win-unpacked\\any-listen.exe","--set-version-string","FileDescription","any-listen","--set-version-string","ProductName","any-listen","--set-version-string","LegalCopyright","Copyright © 2025 lyswhut","--set-file-version","0.4.0-beta.3","--set-p 8788bb97efbecdd3ea87f61cf5bfe32385f409f71b8be2b593b44ec4d1c27fc1 (sha256 hash) (sha256 hash)
  • found existing  path=C:\Users\user\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.6.0
  • execute command  command='C:\Users\user\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.6.0\rcedit-x64.exe' 'H:\any-listen\build\win-unpacked\any-listen.exe' --set-version-string FileDescription any-listen --set-version-string ProductName any-listen --set-version-string LegalCopyright 'Copyright © 2025 lyswhut' --set-file-version 0.4.0-beta.3 --set-product-version 0.4.0.0 --set-version-string InternalName any-listen --set-version-string OriginalFilename '' --set-version-string CompanyName lyswhut --set-version-string LegalTrademarks lyswhut --set-icon 'H:\any-listen\packages\desktop\resources\icons\icon.ico'
                     workingDirectory=
  • command executed  executable=C:\Users\user\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.6.0\rcedit-x64.exe
  • exited          command=app-builder.exe code=0 pid=9548
  • signing with signtool.exe  path=H:\any-listen\build\win-unpacked\any-listen.exe
  • no signing info identified, signing is skipped  signHook=false cscInfo=null
wine&sign: 1s 163ms
  • no event listeners found  event=afterSign

After updating to 26.3.3, I can no longer package the files in the node_modules directory into app.asar:

  • electron-builder  version=26.3.4 os=10.0.19045
  • writing effective config  file=H:\any-listen\build\builder-effective-config.yaml
  • packageManager not detected by file, falling back to environment detection  resolvedPackageManager=pnpm detected=H:\any-listen\packages\desktop
  • detected workspace root for project using packageManager field  pm=pnpm config=pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a resolved=H:\any-listen projectDir=H:\any-listen\packages\desktop
  • executing @electron/rebuild  electronVersion=37.10.3 arch=x64 buildFromSource=false workspaceRoot=H:\any-listen projectDir=./ appDir=./
  • installing native dependencies  arch=x64
  • preparing       moduleName=better-sqlite3 arch=x64
  • finished        moduleName=better-sqlite3 arch=x64
  • completed installing native dependencies
  • packaging       platform=win32 arch=x64 electron=37.10.3 appOutDir=H:\any-listen\build\win-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v37.10.3/electron-v37.10.3-win32-x64.zip size=134 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v37.10.3/electron-v37.10.3-win32-x64.zip duration=1m2.977s
  • no node modules found in collection, trying next search directory  searchDir=H:\any-listen\packages\desktop attempt=0
  • no node modules returned while searching directories  searchDirectories=["","H:\\any-listen"]
  • updating asar integrity executable resource  executablePath=H:\any-listen\build\win-unpacked\any-listen.exe
  • signing with signtool.exe  path=H:\any-listen\build\win-unpacked\any-listen.exe

These warnings appear in builds on Windows, macOS, and Linux.

I noticed that these warnings did not exist in version 26.3.2.

Reproduce:

  1. Clone code
git clone --depth=1 --branch main https://github.com/any-listen/any-listen.git
# build windows package
pnpm i
  1. Update package

For some reason, every time I upgrade electron-builder, I have to uninstall it first and then install the new version. Otherwise, I will get warnings about peer dependency mismatches.

 WARN  Issues with peer dependencies found
packages/desktop
├─┬ dmg-builder 26.3.4
│ └─┬ app-builder-lib 26.3.4
│   └── ✕ unmet peer electron-builder-squirrel-windows@26.3.4: found 26.3.2
└─┬ electron-builder-squirrel-windows 26.3.2
  └─┬ app-builder-lib 26.3.2
    └── ✕ unmet peer dmg-builder@26.3.2: found 26.3.4

Edit packages\desktop\package.json:

-    "electron-builder": "26.3.2",
# This will cause a postinstall error, but we can safely ignore it
pnpm i
+    "electron-builder": "26.3.3",
pnpm i
  1. Build
npm run build:dir

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions