powercord-org / powercord

A lightweight @discord client mod focused on simplicity and performance.
MIT License
1.21k stars 147 forks source link

npm run plug exits with a crash #480

Closed JayCBreak closed 3 years ago

JayCBreak commented 3 years ago

Describe the bug The powercord script crashes when attempting to install dependencies on Ubuntu 20.04.2 LTS

To Reproduce On Ubuntu 20.04.2 LTS:

  1. update git via apt-get
  2. install node.js via snap using sudo snap install node --classic --channel=14
  3. install discord canary via the install link on https://powercord.dev/installation
  4. clone powercord repository to your local machine and move into the powercord repository (using command on https://powercord.dev/installation)
  5. run npm i
  6. run npm run plug The script should run into an error after the text "Installing dependencies, please wait..." with the error message:
child_process.js:655
    throw err;
    ^

Error: Command failed: npm install --only=prod
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at installDeps (/home/sysbreak/git/powercord/injectors/env_check.js:17:3)
    at module.exports (/home/sysbreak/git/powercord/injectors/env_check.js:60:9)
    at Object.<anonymous> (/home/sysbreak/git/powercord/injectors/index.js:8:23)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  status: 243,
  signal: null,
  output: [ null, Buffer(0) [Uint8Array] [], Buffer(0) [Uint8Array] [] ],
  pid: 25697,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(0) [Uint8Array] []

}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! powercord@2.0.0 plug: `node injectors/index.js inject --no-exit-codes`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the powercord@2.0.0 plug script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-04-07T17_06_45_055Z-debug.log

Expected behavior The proper installation of powercord

Desktop

Additional context

Error: Command failed: npm install --only=prod at checkExecSyncError (child_process.js:616:11) at execSync (child_process.js:652:15) at installDeps (/home/sysbreak/git/powercord/injectors/env_check.js:17:3) at module.exports (/home/sysbreak/git/powercord/injectors/env_check.js:60:9) at Object. (/home/sysbreak/git/powercord/injectors/index.js:8:23) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) { status: 243, signal: null, output: [ null, Buffer(0) [Uint8Array] [], Buffer(0) [Uint8Array] [] ], pid: 33794, stdout: Buffer(0) [Uint8Array] [], stderr: Buffer(0) [Uint8Array] [] }


 - The error occurs whether or not discord stable and/or discord canary is running (tested with it being open, closed but open in tray, and completely quit)

Add any other context about the problem here.
LOG FILE:
[2021-04-07T17_06_45_055Z-debug.log](https://github.com/powercord-org/powercord/files/6273435/2021-04-07T17_06_45_055Z-debug.log)
JayCBreak commented 3 years ago

In case anyone else comes across this, I re-read the error and just needed to add --scripts-prepend-node-path to the end of the plug command. sudo npm run plug --scripts-prepend-node-path gave me a proper install.

zt64 commented 3 years ago

I wouldn't advise installing nodejs via snap, or using snap at all. For debian distros you can find the install method on https://www.github.com/nodesource/distributions/tree/master/README.md

JayCBreak commented 3 years ago

I wouldn't advise installing nodejs via snap, or using snap at all. For debian distros you can find the install method on https://www.github.com/nodesource/distributions/tree/master/README.md

Ah! Thanks for the tip!