Repository navigation
No such file in '/home/user/BetterSoundCloud/node_modules/electron/path.txt #99
Description
Activity
@Makar986, I managed to fix this awhile back myself, you just need to install Electron it's self and it should run after you point BSC to the installed version.
@Njill, It didn't help, I'm already using a better service
Fix: Electron install silently fails on Linux (extract-zip bug)
npm installfinishes without errors, but launching the app throws:Error: ENOENT: no such file or directory, open 'node_modules/electron/path.txt'Only
locales/(or a single file) appears innode_modules/electron/dist/, and the actualelectronbinary is missing.Root cause: A Node.js streams regression (nodejs/node#62557) breaks
extract-zip(the library Electron's installer uses internally). The zip downloads correctly and passes checksum validation, but extraction silently stops after the first entry and the process exits with code, no error, no warning. This affects Electron, Cypress, and Playwright installs alike (electron/electron#51623).Workaround: extract manually with the system
unzip- Go to the electron package folder and clear the broken partial extraction:
cd node_modules/electron rm -rf dist- Find the already-downloaded zip in Electron's cache (it's already there, checksum-valid, no re-download needed):
find ~/.cache/electron -name "electron-v*.zip"
- Extract it manually with
unzip(replace the path with what step 2 found):
mkdir -p dist unzip -q "<path_from_step_2>" -d dist- Verify the binary is there:
ls dist/
You should see the
electronexecutable,resources/,locales/, etc. and not just a single file.- Create the missing
path.txtthat the electron npm package expects (on Linux the value is justelectron):
echo -n "electron" > path.txt
- Go back to your project root and run it:
cd ../.. ./start.sh # or npm start / electron-forge start
Notes
- If
findin step 2 comes up empty, the zip may not have downloaded yet, runnode install.jsinsidenode_modules/electronfirst (it'll download+checksum but stall on extraction), then repeat from step 2. - This is a Node.js-level bug, not specific to any Electron fork and the same steps apply whether you're using stock Electron or a custom mirror (e.g. castlabs' Widevine-enabled build).
- Downgrading Node.js to a version predating the regression should also avoid the issue, but manual extraction is faster if you just need to get unblocked.
@AlirezaKJ you really should take a look at this twin
Fix: Electron install silently fails on Linux (extract-zip bug)
npm installfinishes without errors, but launching the app throws:Error: ENOENT: no such file or directory, open 'node_modules/electron/path.txt'Only
locales/(or a single file) appears innode_modules/electron/dist/, and the actualelectronbinary is missing.Root cause: A Node.js streams regression (nodejs/node#62557) breaks
extract-zip(the library Electron's installer uses internally). The zip downloads correctly and passes checksum validation, but extraction silently stops after the first entry and the process exits with code, no error, no warning. This affects Electron, Cypress, and Playwright installs alike (electron/electron#51623).Workaround: extract manually with the system
unzip1. Go to the electron package folder and clear the broken partial extraction:cd node_modules/electron
rm -rf dist2. Find the already-downloaded zip in Electron's cache (it's already there, checksum-valid, no re-download needed):find ~/.cache/electron -name "electron-v*.zip"
3. Extract it manually with `unzip` (replace the path with what step 2 found):mkdir -p dist
unzip -q "<path_from_step_2>" -d dist4. Verify the binary is there:ls dist/
You should see the
electronexecutable,resources/,locales/, etc. and not just a single file.5. Create the missing `path.txt` that the electron npm package expects (on Linux the value is just `electron`):echo -n "electron" > path.txt
6. **Go back to your project root and run it:**cd ../..
./start.sh # or npm start / electron-forge startNotes
* If `find` in step 2 comes up empty, the zip may not have downloaded yet, run `node install.js` inside `node_modules/electron` first (it'll download+checksum but stall on extraction), then repeat from step 2. * This is a Node.js-level bug, not specific to any Electron fork and the same steps apply whether you're using stock Electron or a custom mirror (e.g. castlabs' Widevine-enabled build). * Downgrading Node.js to a version predating the regression should also avoid the issue, but manual extraction is faster if you just need to get unblocked.yoo bro, thank you so much
Reacted by g
[makar@arch ~]$ bash <(curl -fsSL https://raw.githubusercontent.com/AlirezaKJ/BetterSoundCloud/main/install_bettersoundcloud.sh)
=== Installing BetterSoundCloud ===
Checking system requirements...
Detected system: Arch Linux (pacman)
warning: git-2.54.0-1 is up to date -- skipping
warning: curl-8.20.0-7 is up to date -- skipping
there is nothing to do
✔ Node.js is already installed.
Updating existing code...
From https://github.com/AlirezaKJ/BetterSoundCloud
HEAD is now at 25c336b Merge pull request Update npmDepsHash #92 from silverhadch/patch-1
Installing app libraries...
changed 1 package in 818ms
✔ Libraries installed.
Creating launcher script...
Creating desktop entry...
✔ Installation complete!
Run with: /home/makar/BetterSoundCloud/start.sh
[makar@arch ~]$ /home/makar/BetterSoundCloud/start.sh
🔄 Checking for updates...
▶ Starting BetterSoundCloud...
npm warn Unknown project config "electron_mirror". This will stop working in the next major version of npm. See
npm help npmrcfor supported config options.npm warn Unknown project config "electron_use_remote_checksums". This will stop working in the next major version of npm. See
npm help npmrcfor supported config options.✔ Checking your system
✔ Locating application
✔ Loading configuration
✔ Preparing native dependencies [0.1s]
✔ Running generateAssets hook
✔ Running preStart hook
✔ Launched Electron app. Type rs in terminal to restart main process.
Downloading Electron binary...
An unhandled rejection has occurred inside Forge:
Error: ENOENT: no such file or directory, open '/home/makar/BetterSoundCloud/node_modules/electron/path.txt'
at Object.readFileSync (node:fs:436:20)
at getElectronPath (/home/makar/BetterSoundCloud/node_modules/electron/index.js:47:25)
at Object. (/home/makar/BetterSoundCloud/node_modules/electron/index.js:52:18)
at Module._compile (node:internal/modules/cjs/loader:1873:14)
at Object..js (node:internal/modules/cjs/loader:2013:10)
at Module.load (node:internal/modules/cjs/loader:1596:32)
at Module._load (node:internal/modules/cjs/loader:1398:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.require (node:internal/modules/cjs/loader:1619:12)
at require (node:internal/modules/helpers:191:16)
at locateElectronExecutable (/home/makar/BetterSoundCloud/node_modules/@electron-forge/core/dist/util/electron-executable.js:12:28)
at async forgeSpawn (/home/makar/BetterSoundCloud/node_modules/@electron-forge/core/dist/api/start.js:126:32)
at async forgeSpawnWrapper (/home/makar/BetterSoundCloud/node_modules/@electron-forge/core/dist/api/start.js:160:25)
at async /home/makar/BetterSoundCloud/node_modules/@electron-forge/core/dist/api/start.js:197:21
at async /home/makar/BetterSoundCloud/node_modules/@electron-forge/tracer/dist/index.js:58:20
at async /home/makar/BetterSoundCloud/node_modules/@electron-forge/cli/dist/electron-forge-start.js:59:21
[makar@arch ~]$