discordjs / RPC

A simple RPC client for Discord

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[4.0.1] register-scheme displays an error on install

AxelTerizaki opened this issue · comments

As I understand the changelog, register-scheme has been moved from peer dependencies to optional.

Moving it to optional also made it trying to build register-scheme using node-gyp, however, on systems without any build tools, it fails. Since the package is optional, yarn/npm doesn't abort, but it still displays a confusing error message to the end-user trying to pull discord-rpc.

yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@2.3.2: The platform "win32" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "i18next-scanner > acorn-dynamic-import@4.0.0" has incorrect peer dependency "acorn@^6.0.0".
[5/5] Rebuilding all packages...
[1/5] ⠈ register-scheme
[-/5] ⠈ waiting...
[-/5] ⠈ waiting...
[-/5] ⠈ waiting...
warning Error running install script for optional dependency: "C:\\dev\\karaokemugen-app\\node_modules\\register-scheme: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\\dev\\karaokemugen-app\\node_modules\\register-scheme
Output:
C:\\dev\\karaokemugen-app\\node_modules\\register-scheme>if not defined npm_config_node_gyp (node \"C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\node-gyp-bin\\\\..\\..\\node_modules\\node-gyp\\bin\\node-gyp.js\" rebuild )  else (node \"\" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.16.1 | win32 | x64
gyp info find Python using Python version 3.9.5 found at \"C:\\Python39\\python.exe\"
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2019 (16.10.31402.337) found at:
gyp ERR! find VS \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\"
gyp ERR! find VS - \"Visual Studio C++ core features\" missing
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the \"Desktop development with C++\" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack     at VisualStudioFinder.fail (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\find-visualstudio.js:121:47)
gyp ERR! stack     at C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\find-visualstudio.js:74:16
gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\find-visualstudio.js:351:14)
gyp ERR! stack     at C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\find-visualstudio.js:70:14
gyp ERR! stack     at C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\find-visualstudio.js:372:16
gyp ERR! stack     at C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\util.js:54:7
gyp ERR! stack     at C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\lib\\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:315:5)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Program Files\\\\nodejs\\\\node_modules\\\\npm\\\\node_modules\\\\node-gyp\\\\bin\\\\node-gyp.js\" \"rebuild\"
gyp ERR! cwd C:\\dev\\karaokemugen-app\\node_modules\\register-scheme
success Saved lockfile.
Done in 3.70s.

One easy solution would be to revert it to peer dependency, but another would be to provide pre-built binaries for node-register-scheme on different systems. Most packages which include bindings provide these so install doesn't fail.

For now I'll stick to the previous version to keep my users from panicking when they're installing my app :)

@devsnek this is a blocking issue for 4.x, have to revert..

commented

I won't be reverting this.

Excuse me @devsnek but my main question was if you planned to offer pre-built binaries for this so it won't trigger any error message? It's not blocking but the node-gyp messages are confusing and can lead to useless questions from users.