Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Package including other binding.gyp files fails to build on native Windows with "No such file or directory" for binding.sln.gyp.9gyrmwpe.tmp

オープン
#3,040 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
node.js, python

調査の方向性

ネイティブ Windows 上で、ネストされた binding.gyp ファイルを含む binding.gyp を使って node-gyp rebuild の失敗を再現します。まず gyp/pylib/gyp/generator/msvs.py と gyp/pylib/gyp/MSVSNew.py における出力パス処理を追跡し、次に gyp/pylib/gyp/common.py の一時ファイル作成を調べます。生成されたソリューションファイルを、ディレクトリが存在しないというエラーなしに正常に書き込めれば完了です。

索引モデルが issue の本文から書いたものです。

説明

My package @dodona/dolos-parsers fails to build on Windows with the following error:

npm ERR! FileNotFoundError: [Errno 2] No such file or directory: 'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\@dodona\\dolos-parsers\\build\\bash\\binding.sln.gyp.9gyrmwpe.tmp'

This could be caused by how dolos-parsers is structured: it has a binding.gyp that includes other gyp-files of native modules includes as a submodule in our Git repository:

{
    "includes": [
        "bash/binding.gyp",
        "c/binding.gyp",
        ...
    ]
}

By digging through the msvs.py generator I see there are some issues with generating the sln-files within directories, so maybe that is related?

Verbose output (from npm or node-gyp):

From this GH actions run:

npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\tree-sitter',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\npm\prefix\node_modules\@dodona\dolos\node_modules\tree-sitter'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\tree-sitter'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\npm\prefix\node_modules\@dodona\dolos\node_modules\tree-sitter'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\tree-sitter'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\npm\\prefix\\node_modules\\@dodona\\dolos',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\npm\prefix\node_modules\@dodona\dolos\node_modules\tree-sitter'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\tree-sitter'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\npm\\prefix\\node_modules\\@dodona',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\npm\prefix\node_modules\@dodona\dolos\node_modules\tree-sitter'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\tree-sitter'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\npm\prefix\node_modules\@dodona\dolos\node_modules\@dodona\dolos-parsers
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@10.0.1
npm ERR! gyp info using node@21.7.2 | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.2 found at "C:\hostedtoolcache\windows\Python\3.12.2\x64\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v21.7.2/node-v21.7.2-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v21.7.2/node-v21.7.2-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v21.7.2/SHASUMS256.txt
npm ERR! gyp http GET https://nodejs.org/download/release/v21.7.2/win-x64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v21.7.2/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v21.7.2/win-x64/node.lib
npm ERR! gyp info find VS using VS2022 (17.9.34723.18) found at:
npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\hostedtoolcache\windows\Python\3.12.2\x64\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\hostedtoolcache\\windows\\node\\21.7.2\\x64\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\@dodona\\dolos-parsers\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\hostedtoolcache\\windows\\node\\21.7.2\\x64\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\runneradmin\\AppData\\Local\\node-gyp\\Cache\\21.7.2\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\runneradmin\\AppData\\Local\\node-gyp\\Cache\\21.7.2',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\hostedtoolcache\\windows\\node\\21.7.2\\x64\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\runneradmin\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\21.7.2\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\@dodona\\dolos-parsers',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\@dodona\\dolos-parsers\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 45, in <module>
npm ERR!     sys.exit(gyp.script_main())
npm ERR!              ^^^^^^^^^^^^^^^^^
npm ERR!   File "C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 688, in script_main
npm ERR!     return main(sys.argv[1:])
npm ERR!            ^^^^^^^^^^^^^^^^^^
npm ERR!   File "C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 680, in main
npm ERR!     return gyp_main(args)
npm ERR!            ^^^^^^^^^^^^^^
npm ERR!   File "C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 665, in gyp_main
npm ERR!     generator.GenerateOutput(flat_list, targets, data, params)
npm ERR!   File "C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2157, in GenerateOutput
npm ERR!     sln = MSVSNew.MSVSSolution(
npm ERR!           ^^^^^^^^^^^^^^^^^^^^^
npm ERR!   File "C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 228, in __init__
npm ERR!     self.Write()
npm ERR!   File "C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.py", line 255, in Write
npm ERR!     f = writer(self.path)
npm ERR!         ^^^^^^^^^^^^^^^^^
npm ERR!   File "C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\common.py", line 415, in WriteOnDiff
npm ERR!     return Writer()
npm ERR!            ^^^^^^^^
npm ERR!   File "C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\common.py", line 353, in __init__
npm ERR!     tmp_fd, self.tmp_path = tempfile.mkstemp(
npm ERR!                             ^^^^^^^^^^^^^^^^^
npm ERR!   File "C:\hostedtoolcache\windows\Python\3.12.2\x64\Lib\tempfile.py", line 357, in mkstemp
npm ERR!     return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
npm ERR!            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR!   File "C:\hostedtoolcache\windows\Python\3.12.2\x64\Lib\tempfile.py", line 256, in _mkstemp_inner
npm ERR!     fd = _os.open(file, flags, 0o600)
npm ERR!          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! FileNotFoundError: [Errno 2] No such file or directory: 'C:\\npm\\prefix\\node_modules\\@dodona\\dolos\\node_modules\\@dodona\\dolos-parsers\\build\\bash\\binding.sln.gyp.9gyrmwpe.tmp'
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (C:\hostedtoolcache\windows\node\21.7.2\x64\node_modules\npm\node_modules\node-gyp\lib\configure.js:271:18)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:519:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.20348
npm ERR! gyp ERR! command "C:\\hostedtoolcache\\windows\\node\\21.7.2\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\\21.7.2\\x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\npm\prefix\node_modules\@dodona\dolos\node_modules\@dodona\dolos-parsers
npm ERR! gyp ERR! node -v v21.7.2
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: C:\npm\cache\_logs\2024-04-10T12_56_36_832Z-debug-0.log
node:internal/modules/cjs/loader:1145
  throw err;
  ^

Error: Cannot find module 'C:\npm\prefix\node_modules\@dodona\dolos\dist\cli.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1142:15)
    at Module._load (node:internal/modules/cjs/loader:983:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
主要言語
Python
スター
10.7k
フォーク
1.9k
平均マージ
1日 4時間
マージ済み PR(30日)
5

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nodejs/node-gyp のほかの issue

nodejs/node-gyp の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。