iArxic / StudioPresence

Connect your Studio with Discord!
ISC License
24 stars 6 forks source link

"Cannot find module 'discord-rpc'" discord-rpc module not installed when running "runner.bat" #1

Closed TymonMarek closed 1 year ago

TymonMarek commented 1 year ago

Node output after running "runner.bat"

runner.bat
node:internal/modules/cjs/loader:1042
  throw err;
  ^

Error: Cannot find module 'discord-rpc'
Require stack:
- __HIDDEN__\StudioPresence\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
    at Module._load (node:internal/modules/cjs/loader:885:27)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (__HIDDEN__\StudioPresence\index.js:1:12)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '__HIDDEN__\\StudioPresence\\index.js'
  ]
}

Node.js v19.2.0

Attempting to install 'discord-rpc' manually

npm i discord-rpc
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path __HIDDEN__\StudioPresence\node_modules\register-scheme
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@19.2.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.9 found at "__HIDDEN__\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (__HIDDEN__\StudioPresence\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at __HIDDEN__\StudioPresence\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (__HIDDEN__\StudioPresence\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at __HIDDEN__\StudioPresence\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at __HIDDEN__\StudioPresence\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at __HIDDEN__\StudioPresence\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at __HIDDEN__\StudioPresence\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:427:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1098:16)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "__HIDDEN__\\StudioPresence\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd __HIDDEN__\StudioPresence\node_modules\register-scheme
npm ERR! gyp ERR! node -v v19.2.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     __HIDDEN__\npm-cache\_logs\2022-12-11T16_59_05_612Z-debug-0.log

HIDDEN\npm-cache_logs\2022-12-11T16_59_05_612Z-debug-0.log

2022-12-11T16_59_05_612Z-debug-0.log.log

TymonMarek commented 1 year ago

Hardware and software of the computer which this error occurs on:

OS Name:                   Microsoft Windows 11 Home
OS Version:                10.0.22621 N/A Build 22621
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
System Manufacturer:       Micro-Star International Co., Ltd.
System Model:              MS-7D46
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 151 Stepping 2 GenuineIntel ~2500 Mhz
BIOS Version:              American Megatrends International, LLC. 2.91, 11/10/2022
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-gb;English (United Kingdom)
Input Locale:              en-gb;English (United Kingdom)
Time Zone:                 (UTC+00:00) Dublin, Edinburgh, Lisbon, London
Total Physical Memory:     16,244 MB
Available Physical Memory: 5,615 MB
Virtual Memory: Max Size:  25,460 MB
Virtual Memory: Available: 8,201 MB
Virtual Memory: In Use:    17,259 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\HOME
Hotfix(s):                 4 Hotfix(s) Installed.
                           [01]: KB5020622
                           [02]: KB5012170
                           [03]: KB5019980
                           [04]: KB5019304
TymonMarek commented 1 year ago

This issue seems to be caused by windows 11 not having a package that is commonly installed by default on windows 10.

TymonMarek commented 1 year ago

Coyenn's fork seems to fix this issue, likely because it is compiled binary.

iArxic commented 1 year ago

Thank you for your report, I'll publish another version soon!

iArxic commented 1 year ago

Fixed with v2