Error while installing discord-rpc
huantianad opened this issue · 14 comments
Describe the bug
The program is unable to install node packages, and seems to failing at installing discord-rpc. Running start.sh
results in the message An error occurred while installing modules.
, and manual npm i
output is provided below.
To Reproduce
Steps to reproduce the behavior:
- Download Linux version of program.
- Unzip
- Run
start.sh
Terminal output
terminal-output.txt
npm.log
Your Setup:
- OS: Linux
- NodeJS version: v16.11.1
- npm version: 8.1.3
Try updating node-gyp
: (as superuser) npm install -g node-gyp@latest
since your version is out of date by an entire major release.
I'm using arch and node-gyp is installed via pacman, so using npm to update it would probably break the package unfortunately, so I'll probably hold off on that. I do have version 8.2.0, which is only 2 minor versions behind though.
For whatever reason then, npm
is grabbing some other installation of node-gyp on your system, judging by this:
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.```
Seems like it's trying to use the node-gyp bundled with my npm installation instead of my global one, so seems to be something on my end.
if you have node-gyp bundled with npm already, npm install -g node-gyp@latest
would update it and not affect the pacman package any more than it already does, no? worth a try.
Or maybe just remove the npm-bundled version and hope that it defaults to the pacman version.
same problem here
i use arch linux btw
i too use arch btw but mine's better than yours because i also use dwm
if you have node-gyp bundled with npm already,
npm install -g node-gyp@latest
would update it and not affect the pacman package any more than it already does, no? worth a try.Or maybe just remove the npm-bundled version and hope that it defaults to the pacman version.
The problem is that the pacman node-gyp and npm -g node-gyp are installed in /usr/lib/node_modules/node-gyp/
, while when installing it's using /usr/lib/node_modules/npm/node_modules/node-gyp/
The problem is that the pacman node-gyp and npm -g node-gyp are installed in
/usr/lib/node_modules/node-gyp/
, while when installing it's using/usr/lib/node_modules/npm/node_modules/node-gyp/
I think you might wanna reinstall npm, and make sure you only have one installation of it at a time. Haven't been able to reproduce the issue on my end.
It seems like /usr/lib/node_modules/npm/node_modules/node-gyp/
should not have been there, wasn't part of my node or npm installation, removed it and it seems to work. Thanks for the help!
Oh, interesting, i wonder how that got there then. Glad you could get it working!
Yeah it's super weird, no idea how it got there, maybe from like a previous version of the package? that should've been removed if so though.
I just checked on my system (Up-to-date Arch install that i've had for a few years), and I too have /usr/lib/node_modules/npm/node_modules/node-gyp
. In theory that folder should be owned by the pacman package npm
which I have installed, but it isn't.
Could be a remnant from an old version, or updating npm
using itself requires it as a build dependency? Oh well, can't be very important lol.