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

Path does not end with the package name #8558

Closed
timeowilliams opened this issue Oct 4, 2024 · 8 comments · Fixed by #8560
Closed

Path does not end with the package name #8558

timeowilliams opened this issue Oct 4, 2024 · 8 comments · Fixed by #8560
Assignees

Comments

@timeowilliams
Copy link

timeowilliams commented Oct 4, 2024

  • Electron-Builder Version: 25.1.7
  • Node Version: node v20.17.0 (npm v10.8.2)
32.1.2
  • Electron Version: 32.1.2
  • Electron Type (current, beta, nightly): current
6.3.9
  • Target: arm-64 (MACOS)

Operating system: MacOS M1 Macbook Pro

When I recently upgraded electron-builder from 25.0.5 to 25.1.7, I receive this new error after running this script from my package.json:

{
    "build:mac": "NODE_ENV=production electron-vite build && electron-builder --mac",
}

Path does not end with the package name.

I used pnpm as my package manager. When I downgrade back to 25.0.5, I have no issues with running electron-builder and having a DMG I can open.

Error Logs:

timeo@MacBook-Pro-9 deepWork % pnpm build:mac

> deepFocus@1.2.0 build:mac /Users/timeo/deepFocus/deepWork
> NODE_ENV=production electron-vite build && electron-builder --mac

vite v5.4.8 building SSR bundle for production...
✓ 5 modules transformed.
out/main/chunks/types-ByjAwHK0.js   0.59 kB
out/main/worker.js                  3.41 kB
out/main/childProcess.js            3.79 kB
out/main/main.js                   14.28 kB
✓ built in 371ms
vite v5.4.8 building SSR bundle for production...
✓ 1 modules transformed.
out/preload/index.mjs  0.48 kB
✓ built in 10ms
vite v5.4.8 building for production...
✓ 178 modules transformed.
../../out/renderer/index.html                                 0.90 kB
../../out/renderer/assets/deepFocus-DDUlmG2r.ico              4.29 kB
../../out/renderer/assets/index-Dlr8kzwH.css                 35.88 kB
../../out/renderer/assets/Onboarding-tn-8ewtX.js              1.25 kB
../../out/renderer/assets/Settings-CQYUBAsl.js                1.79 kB
../../out/renderer/assets/Login--a5mDxK6.js                   3.89 kB
../../out/renderer/assets/Signup-Dn4YoS7S.js                  6.54 kB
../../out/renderer/assets/UnproductiveWebsites-BUuGJv5x.js    7.84 kB
../../out/renderer/assets/text-field-CWV7ZyNN.js             14.28 kB
../../out/renderer/assets/config-LYy7bBar.js                 30.98 kB
../../out/renderer/assets/index-DKPwEEZJ.js                 174.39 kB
../../out/renderer/assets/Home-EX8oIuqP.js                  184.67 kB
../../out/renderer/assets/BarChart-BamWK6PV.js              324.82 kB
✓ built in 1.30s
  • electron-builder  version=25.1.7 os=23.5.0
  • loaded configuration  file=/Users/timeo/deepFocus/deepWork/electron-builder.yml
  • writing effective config  file=dist/builder-effective-config.yaml
  • skipped dependencies rebuild  reason=npmRebuild is set to false
  • packaging       platform=darwin arch=arm64 electron=32.1.2 appOutDir=dist/mac-arm64
  ⨯ Path does not end with the package name  failedTask=build stackTrace=Error: Path does not end with the package name
    at getRealSource (/Users/timeo/deepFocus/deepWork/node_modules/.pnpm/app-builder-lib@25.1.7_dmg-builder@25.1.7_electron-builder-squirrel-windows@25.1.7__electron-_h3zxlcju6gjppr6yd36lclvgbu/node_modules/app-builder-lib/src/util/appFileCopier.ts:194:13)
    at computeNodeModuleFileSets (/Users/timeo/deepFocus/deepWork/node_modules/.pnpm/app-builder-lib@25.1.7_dmg-builder@25.1.7_electron-builder-squirrel-windows@25.1.7__electron-_h3zxlcju6gjppr6yd36lclvgbu/node_modules/app-builder-lib/src/util/appFileCopier.ts:225:24)
    at /Users/timeo/deepFocus/deepWork/node_modules/.pnpm/app-builder-lib@25.1.7_dmg-builder@25.1.7_electron-builder-squirrel-windows@25.1.7__electron-_h3zxlcju6gjppr6yd36lclvgbu/node_modules/app-builder-lib/src/platformPackager.ts:401:34
    at async Promise.all (index 0)
    at AsyncTaskManager.awaitTasks (/Users/timeo/deepFocus/deepWork/node_modules/.pnpm/builder-util@25.1.7/node_modules/builder-util/src/asyncTaskManager.ts:65:25)
    at MacPackager.doPack (/Users/timeo/deepFocus/deepWork/node_modules/.pnpm/app-builder-lib@25.1.7_dmg-builder@25.1.7_electron-builder-squirrel-windows@25.1.7__electron-_h3zxlcju6gjppr6yd36lclvgbu/node_modules/app-builder-lib/src/platformPackager.ts:293:5)
    at MacPackager.pack (/Users/timeo/deepFocus/deepWork/node_modules/.pnpm/app-builder-lib@25.1.7_dmg-builder@25.1.7_electron-builder-squirrel-windows@25.1.7__electron-_h3zxlcju6gjppr6yd36lclvgbu/node_modules/app-builder-lib/src/macPackager.ts:215:9)
    at Packager.doBuild (/Users/timeo/deepFocus/deepWork/node_modules/.pnpm/app-builder-lib@25.1.7_dmg-builder@25.1.7_electron-builder-squirrel-windows@25.1.7__electron-_h3zxlcju6gjppr6yd36lclvgbu/node_modules/app-builder-lib/src/packager.ts:459:9)
    at executeFinally (/Users/timeo/deepFocus/deepWork/node_modules/.pnpm/builder-util@25.1.7/node_modules/builder-util/src/promise.ts:12:14)
    at Packager.build (/Users/timeo/deepFocus/deepWork/node_modules/.pnpm/app-builder-lib@25.1.7_dmg-builder@25.1.7_electron-builder-squirrel-windows@25.1.7__electron-_h3zxlcju6gjppr6yd36lclvgbu/node_modules/app-builder-lib/src/packager.ts:393:31)
    at executeFinally (/Users/timeo/deepFocus/deepWork/node_modules/.pnpm/builder-util@25.1.7/node_modules/builder-util/src/promise.ts:12:14)
 ELIFECYCLE  Command failed with exit code 1.
timeo@MacBook-Pro-9 deepWork % 
@mmaietta
Copy link
Collaborator

mmaietta commented Oct 4, 2024

@beyondkmp can you please take a look at this? Looks like the new log message was added recently in
#8547

@timeowilliams can you share a minimum reproducible repo for this by chance? I'd like to add a unit test for our node module collector logic specific to your use case

@timeowilliams
Copy link
Author

@mmaietta , absolutely:

Steps:

  1. Clone repo (https://github.com/Tech-Nest-Ventures/deepFocus)
  2. pnpm install
  3. pnpm build:mac

You should have a successfull build.

Then, once you run pnpm update > it'll update electron-builder to the latest version
And if you run pnpm build:mac, you'll have the error: Path does not end with package name

@beyondkmp
Copy link
Collaborator

beyondkmp commented Oct 5, 2024

The @isaacs/cliui package depends on string-width-cjs@4.2.3, but the package that's actually downloaded is string-width@4.2.3. The name in the path doesn't match the original name, which is causing an error.
Fix solution: Truncate based on scope depth, not by name.

"string-width-cjs": {
          "from": "string-width",
          "version": "4.2.3",
          "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
          "description": "Get the visual width of a string - the number of columns required to display it",
          "license": "MIT",
          "author": {
            "name": "Sindre Sorhus",
            "email": "sindresorhus@gmail.com",
            "url": "sindresorhus.com"
          },
          "homepage": "https://github.com/sindresorhus/string-width#readme",
          "repository": "git+https://github.com/sindresorhus/string-width.git",
          "path": "/Users/beyondkmp/Code/deepFocus/node_modules/.pnpm/string-width@4.2.3/node_modules/string-width",
}                 
                             

@zigo233
Copy link

zigo233 commented Oct 9, 2024

I used npm as my package manager and received this error too. Seems like I need to modify the package.json above the solution, but I have no idea which package imported is wrong. By the way, could you tell me how to downgrade back to v25.0.5 or specific the version of electron-builder when I spawn build process.

@a1198186506
Copy link

@zigo233 if you using npm ,change electron-builder version for v25.0.5 in package.json ,if someone who useing pnpm,delete the pnpm.lock and change electron-builder version for v25.0.5 in package.json,then use npm for download the package

@beyondkmp
Copy link
Collaborator

@zigo233 You can test v26.0.0-alpha.1

@wensc1996
Copy link

The "25.1.6" version of the "electron builder" and the "element plus": "^ 2.8.5" will encounter this issue. Removing the "element plus" will fix it. The reason is unclear, but "element plus" is important

@mmaietta
Copy link
Collaborator

Fix is in v25.1.8

mflorea added a commit to xwiki-contrib/cristal that referenced this issue Oct 29, 2024
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

Successfully merging a pull request may close this issue.

6 participants