nukeop / nuclear

Streaming music player that finds free music for you
https://nuclear.js.org/
GNU Affero General Public License v3.0
11.72k stars 1.02k forks source link

App can't run after built ,the reason is scanner used the build machine's path #1611

Open wanyingwe opened 1 month ago

wanyingwe commented 1 month ago

Platform: ubuntu 22 on amd-x64 Nuclear version: the latest version, commit-id: b1533c5ee2ec69c8f2ec9d92728cea8a1f6ed1d7 Description of the issue: I bulit the nuclear APP on my computer, used command: npm run build:linux, Then i tried to run the App on another computer, but it ran failed. Maybe somewhere in the project have used absolute-path, but i can hardly find it...

Here is the error info:

A JavaScript error occurred in the main process Uncaught Exception: Error: Cannot open /home/xxx/electron/example/nuclear/node_modules/@nuclear/scanner/index.node: Error: /home/xxx/electron/example/nuclear/node_modules/@nuclear/scanner/index.node: cannot open shared object file: No such file or directory at Object.../../node_modules/@nuclear/scanner/index.node (/opt/nuclear/resources/app.asar/dist/main.js:4:5836138) at webpack_require (/opt/nuclear/resources/app.asar/dist/main.js:1939:2651305) at Object../src/controllers/local-library.ts (/opt/nuclear/resources/app.asar/dist/main.js:4:7570402) at webpack_require (/opt/nuclear/resources/app.asar/dist/main.js:1939:2651305) at Object../src/ioc.ts (/opt/nuclear/resources/app.asar/dist/main.js:4:7584739) at webpack_require (/opt/nuclear/resources/app.asar/dist/main.js:1939:2651305) at Object../src/main.ts (/opt/nuclear/resources/app.asar/dist/main.js:4:7586768) at webpack_require (/opt/nuclear/resources/app.asar/dist/main.js:1939:2651305) at /opt/nuclear/resources/app.asar/dist/main.js:1939:2653277 at Object. (/opt/nuclear/resources/app.asar/dist/main.js:1939:2653315) at Module._compile (internal/modules/cjs/loader.js:1078:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1108:10) at Module.load (internal/modules/cjs/loader.js:935:32) at Module._load (internal/modules/cjs/loader.js:776:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12913) at Object. (electron/js2c/browser_init.js:197:3336) at Object../lib/browser/init.ts (electron/js2c/browser_init.js:197:3540) at __webpack_require__ (electron/js2c/browser_init.js:1:128) at electron/js2c/browser_init.js:1:1200 at electron/js2c/browser_init.js:1:1267 at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:283:7) at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:225:10)

nukeop commented 1 month ago

Thanks for reporting. I distinctly remember there was a way to repace this path with webpack, but now I can't find it. Maybe I forgot to commit it?

wanyingwe commented 1 month ago

Thanks for reporting. I distinctly remember there was a way to repace this path with webpack, but now I can't find it. Maybe I forgot to commit it?

Thank you for reply. Because I am not familiar with the packaging process, so I'm so sorry that I cannot help you find the problem. I hope you can fix it later.

nukeop commented 1 month ago

Ok, as far as I can tell, this is already linked by webpack using node-loader. The package should be built when you install dependencies using lerna. And later on when the whole app is being built, electron-builder puts the .node binaries into the .asar archive. Could you please confirm what commands you ran to build Nuclear? It's possible that there was a missing step somewhere or things were done out of order for some reason.

wanyingwe commented 1 month ago

Ok, as far as I can tell, this is already linked by webpack using node-loader. The package should be built when you install dependencies using lerna. And later on when the whole app is being built, electron-builder puts the .node binaries into the .asar archive. Could you please confirm what commands you ran to build Nuclear? It's possible that there was a missing step somewhere or things were done out of order for some reason.

I uesd this command : npm run build:linux