deezer icon indicating copy to clipboard operation
deezer copied to clipboard

Error: Cannot find module 'reflect-metadata'

Open DrowKing opened this issue 2 years ago • 2 comments

After following the installation instructions, when I try to run the program I get the following error message

App threw an error during load
Error: Cannot find module 'reflect-metadata'
Require stack:
- /usr/share/deezer/app.asar/build/main.js
- /usr/lib/node_modules/electron/dist/resources/default_app.asar/main.js
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
    at Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128)
    at Module._load (internal/modules/cjs/loader.js:732:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at /usr/share/deezer/app.asar/build/main.js:51:5
    at /usr/share/deezer/app.asar/build/main.js:3284:5
    at Object.<anonymous> (/usr/share/deezer/app.asar/build/main.js:3286:3)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'reflect-metadata'
Require stack:
- /usr/share/deezer/app.asar/build/main.js
- /usr/lib/node_modules/electron/dist/resources/default_app.asar/main.js
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
    at Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128)
    at Module._load (internal/modules/cjs/loader.js:732:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:959:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at /usr/share/deezer/app.asar/build/main.js:51:5
    at /usr/share/deezer/app.asar/build/main.js:3284:5
    at Object.<anonymous> (/usr/share/deezer/app.asar/build/main.js:3286:3)
    at Module._compile (internal/modules/cjs/loader.js:1078:30)

I am using Linux Mint 20.3 if that helps

DrowKing avatar Aug 17 '22 03:08 DrowKing

LIterally the same error happened to me on Linux Mint 21.

Whilst the script reported 'Successfully installed Deezer Desktop!', it threw an error before, probably derailing the entire build process:

2022-10-03 04:23:47 (4.00 MB/s) - ‘deezer-5.30.300-setup.exe’ saved [76081608/76081608]

internal/fs/utils.js:332
    throw err;
    ^

Error: ENAMETOOLONG: name too long, open 'app/build/assets/cache/js/vendors~fullscreen-SelectProfile~modal-OptinGdpr~modal-PlaylistAssistant~modal-Sharing~route-account~17bc459a.0be277a184c0d6c9524b.js.LICENSE.txt'
    at Object.openSync (fs.js:498:3)
    at Object.writeFileSync (fs.js:1529:35)
    at Object.module.exports.extractAll (/usr/lib/node_modules/asar/lib/asar.js:205:10)
    at Command.<anonymous> (/usr/lib/node_modules/asar/bin/asar.js:72:10)
    at Command.listener [as _actionHandler] (/usr/lib/node_modules/asar/node_modules/commander/index.js:413:31)
    at Command._parseCommand (/usr/lib/node_modules/asar/node_modules/commander/index.js:914:14)
    at Command._dispatchSubcommand (/usr/lib/node_modules/asar/node_modules/commander/index.js:865:18)
    at Command._parseCommand (/usr/lib/node_modules/asar/node_modules/commander/index.js:882:12)
    at Command.parse (/usr/lib/node_modules/asar/node_modules/commander/index.js:717:10)
    at Object.<anonymous> (/usr/lib/node_modules/asar/bin/asar.js:80:9) {
  errno: -36,
  syscall: 'open',
  code: 'ENAMETOOLONG',
  path: 'app/build/assets/cache/js/vendors~fullscreen-SelectProfile~modal-OptinGdpr~modal-PlaylistAssistant~modal-Sharing~route-account~17bc459a.0be277a184c0d6c9524b.js.LICENSE.txt'
}
rm: cannot remove 'app/node_modules/@nodert': No such file or directory

> [email protected] install /home/striczkof/Downloads/deezer/npm_temp/node_modules/abstract-socket
> node-gyp rebuild

make: Entering directory '/home/striczkof/Downloads/deezer/npm_temp/node_modules/abstract-socket/build'
  CXX(target) Release/obj.target/bindings/src/abstract_socket.o
In file included from ../../nan/nan.h:60,
                 from ../src/abstract_socket.cc:5:
/home/striczkof/.cache/node-gyp/14.20.1/include/node/node.h:793:7: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  793 |       (node::addon_register_func) (regfunc),                          \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/striczkof/.cache/node-gyp/14.20.1/include/node/node.h:827:3: note: in expansion of macro ‘NODE_MODULE_X’
  827 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/abstract_socket.cc:181:1: note: in expansion of macro ‘NODE_MODULE’
  181 | NODE_MODULE(abstract_socket, Initialize)
      | ^~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/bindings.node
  COPY Release/bindings.node
make: Leaving directory '/home/striczkof/Downloads/deezer/npm_temp/node_modules/abstract-socket/build'
npm WARN saveError ENOENT: no such file or directory, open '/home/striczkof/Downloads/deezer/npm_temp/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/striczkof/Downloads/deezer/npm_temp/package.json'
npm WARN npm_temp No description
npm WARN npm_temp No repository field.
npm WARN npm_temp No README data
npm WARN npm_temp No license field.

Just for the record, the script managed to build successfully on Ubuntu 22.04 Just in case it might be relevant. I'm using BTRFS on my Linux Mint 21 installation whilst I was using ext4 on Ubuntu 22.04.

alvinpeters avatar Oct 02 '22 17:10 alvinpeters

Facing exactly the same problem here on Linux Mint 20.3. Worked without any issues on Ubuntu 20.04 Thanks in advance.

kskollepara avatar Oct 06 '22 20:10 kskollepara