質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

Q&A

2回答

14753閲覧

Node-gyp にて大量のエラーメッセージ

退会済みユーザー

退会済みユーザー

総合スコア0

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

0グッド

0クリップ

投稿2019/07/21 17:55

前提・実現したいこと

それは node-opus をインストールしようとした時です。
コマンドラインが一気に埋め尽くされていくではありませんか!
何をすれば(どうすれば)問題なくインストールすることが出来るか、
お教えください。

発生している問題・エラーメッセージ

> ref@1.3.5 install C:\Users\裕斗\Projects\bot\Node.js\node_modules\ref > node-gyp rebuild C:\Users\裕斗\Projects\bot\Node.js\node_modules\ref>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Traceback (most recent call last): File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module> sys.exit(gyp.script_main()) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main return main(sys.argv[1:]) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main return gyp_main(args) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 514, in gyp_main options.duplicate_basename_check) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 98, in Load generator.CalculateVariables(default_variables, params) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1916, in CalculateVariables generator_flags.get('msvs_version', 'auto')) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) KeyError: '=' gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:345:16) gyp ERR! stack at ChildProcess.emit (events.js:203:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Windows_NT 10.0.18362 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:\Users\裕斗\Projects\bot\Node.js\node_modules\ref gyp ERR! node -v v12.6.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok > node-opus@0.3.2 install C:\Users\裕斗\Projects\bot\Node.js\node_modules\node-opus > node-gyp rebuild C:\Users\裕斗\Projects\bot\Node.js\node_modules\node-opus>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Traceback (most recent call last): File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module> sys.exit(gyp.script_main()) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main return main(sys.argv[1:]) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main return gyp_main(args) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 514, in gyp_main options.duplicate_basename_check) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 98, in Load generator.CalculateVariables(default_variables, params) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1916, in CalculateVariables generator_flags.get('msvs_version', 'auto')) File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) KeyError: '=' gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:345:16) gyp ERR! stack at ChildProcess.emit (events.js:203:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Windows_NT 10.0.18362 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:\Users\裕斗\Projects\bot\Node.js\node_modules\node-opus gyp ERR! node -v v12.6.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN discord.js@11.5.1 requires a peer of bufferutil@^4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.5.1 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.5.1 requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.5.1 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.5.1 requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.5.1 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself. npm WARN discord.js@11.5.1 requires a peer of @discordjs/uws@^10.149.0 but none is installed. You must install peer dependencies yourself. npm WARN discord-bot@2.4.1-b No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ref@1.3.5 (node_modules\ref): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ref@1.3.5 install: `node-gyp rebuild` npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-opus@0.3.2 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-opus@0.3.2 install 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! C:\Users\裕斗\AppData\Roaming\npm-cache\_logs\2019-07-21T15_57_50_956Z-debug.log

試したこと

C:\Users\裕斗 にある .node-gyp を消した
npm を最新版にした
node-gyp も最新のものに
node-gyp rebuild をした → エラー

gyp info it worked if it ends with ok gyp info using node-gyp@5.0.3 gyp info using node@12.6.0 | win32 | x64 gyp info find Python using Python version 2.7.16 found at "C:\Python27\python.exe" gyp info find VS using VS2019 (16.1.29102.190) found at: gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" gyp info find VS run with --verbose for detailed information gyp info spawn C:\Python27\python.exe gyp info spawn args [ gyp info spawn args 'C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-I', gyp info spawn args 'C:\Users\裕斗\Projects\bot\Node.js\build\config.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\裕斗\AppData\Local\node-gyp\Cache\12.6.0\include\node\common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=C:\Users\裕斗\AppData\Local\node-gyp\Cache\12.6.0', gyp info spawn args '-Dnode_gyp_dir=C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\Users\裕斗\AppData\Local\node-gyp\Cache\12.6.0\<(target_arch)\node.lib', gyp info spawn args '-Dmodule_root_dir=C:\Users\裕斗\Projects\bot\Node.js', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'C:\Users\裕斗\Projects\bot\Node.js\build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp: binding.gyp not found (cwd: C:\Users\裕斗\Projects\bot\Node.js) while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:344:16) gyp ERR! stack at ChildProcess.emit (events.js:203:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\裕斗\Projects\bot\Node.js gyp ERR! node -v v12.6.0 gyp ERR! node-gyp -v v5.0.3 gyp ERR! not ok

Visual Studio Build Tools も 2019年版にした (msvs_version も一緒に)
・パスの空白をなくした
node-gyp の GitHub の Issue を見てパスに日本語が入っていても大丈夫な設定にした
・PC を変えた

補足情報(FW/ツールのバージョンなど)

OS: Windows_NT 10.0.18362
VS: VS2019 (16.1.29102.190)
Node: node v12.6.0
Node-gyp: node-gyp@5.0.3

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

同じ問題に遭遇し、StackOverFlowを見て解決したので共有します。
node-gyp configure got “gyp ERR! find VS” - Stack Overflow

エラーメッセージを見ると
"gyp ERR! find VS including the "Desktop development with C++" workload."
という文言がありますね。

Visual Studioに加えて、C++の開発ツールのインストールが必要です。
手順は以下のとおりです。
(node.js、npm、node-gyp、Visual Studio、Visual Studio Installerは必要に応じて最新にしてください。)

  1. Visual Studioを起動
  2. 「ツール > ツールと機能を取得」と選択し、Visual Studio Installerを起動

イメージ説明

  1. 「C++によるデスクトップ開発」に☑をつけて「変更」

イメージ説明

インストールが始まります。しばらく待ち、インストールに成功していたら再度
node-gyp rebuild
を実行してみてください。

投稿2020/03/13 18:27

編集2020/03/13 18:31
takeaship

総合スコア129

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

windows-build-toolsはインストールしましたか?

node-gypはあくまでビルドを管理するツールですので、実際のコンパイラが別途で必要です。

投稿2019/07/21 22:27

maisumakun

総合スコア145183

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2019/07/22 08:35 編集

どうやら "windows-build-tools" が "Visual Studio Build Tools" の様です。 インストールしたら : "VS2013" は "Node.js 8" じゃないと対応しない 最新版をインストールしてくれ とのことでした... ただひとつ、疑問に思いました。 Visual Studio Installer を見ると、 ちゃんと VS2017 がインストールされていました... - 発生している問題・エラーメッセージ - gyp info it worked if it ends with ok gyp info using node-gyp@5.0.3 gyp info using node@12.6.0 | win32 | x64 gyp info find Python using Python version 2.7.16 found at "C:\Python27\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 could not use PowerShell to find Visual Studio 2017 or newer 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:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47) gyp ERR! stack at C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:344:14) gyp ERR! stack at C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14 gyp ERR! stack at C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:365:16 gyp ERR! stack at C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\lib\util.js:54:7 gyp ERR! stack at C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\lib\util.js:33:16 gyp ERR! stack at ChildProcess.exithandler (child_process.js:304:5) gyp ERR! stack at ChildProcess.emit (events.js:203:13) gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\裕斗\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\裕斗\Projects\bot\Node.js gyp ERR! node -v v12.6.0 gyp ERR! node-gyp -v v5.0.3 gyp ERR! not ok - ご回答ありがとうございました -
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問