WMPFDebugger icon indicating copy to clipboard operation
WMPFDebugger copied to clipboard

yarn 安装报错 MEGA THREAD

Open 1585370420 opened this issue 2 months ago • 24 comments

python3.9 nodejs 22

(py39) D:\WMPFDebugger-main\WMPFDebugger-main\WMPFDebugger-main>yarn yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... [1/2] ⠁ frida error D:\WMPFDebugger-main\WMPFDebugger-main\WMPFDebugger-main\node_modules\frida: Command failed. Exit code: 1 Command: node scripts/install.js Arguments: Directory: D:\WMPFDebugger-main\WMPFDebugger-main\WMPFDebugger-main\node_modules\frida Output: prebuild-install warn install Request timed out Downloading toolchain 20250919... Extracting toolchain... Downloading SDK 20250919 for windows-x86_64-mt... Extracting SDK... [WinError 5] �ܾ����ʡ�: 'D:\WMPFDebugger-main\WMPFDebugger-main\WMPFDebugger-main\node_modules\frida\deps\_sdk-windows-x86_64-mt' -> 'D:\WMPFDebugger-main\WMPFDebugger-main\WMPFDebugger-main\node_modules\frida\deps\sdk-windows-x86_64-mt'

1585370420 avatar Sep 25 '25 12:09 1585370420

prebuild-install warn install Request timed out

检查网络问题,更多细节参考 #57

evi0s avatar Sep 25 '25 16:09 evi0s

error D:\WMPFDebugger-main\aaa\WMPFDebugger-main\WMPFDebugger-main\node_modules\frida: Command failed. Exit code: 1 Command: node scripts/install.js Arguments: Directory: D:\WMPFDebugger-main\aaa\WMPFDebugger-main\WMPFDebugger-main\node_modules\frida Output: prebuild-install warn install No prebuilt binaries found (target=8 runtime=napi arch=x64 libc= platform=win32) Downloading toolchain 20250919... Extracting toolchain... Downloading SDK 20250919 for windows-x86_64-mt... Extracting SDK... [WinError 5] �ܾ����ʡ�: 'D:\WMPFDebugger-main\aaa\WMPFDebugger-main\WMPFDebugger-main\node_modules\frida\deps\_sdk-windows-x86_64-mt' -> 'D:\WMPFDebugger-main\aaa\WMPFDebugger-main\WMPFDebugger-main\node_modules\frida\deps\sdk-windows-x86_64-mt' 看着不像是网络问题,像是frida环境问题,尝试了好多次,一直这个报错

1585370420 avatar Sep 26 '25 03:09 1585370420

OK,看来可能环境是可能有点问题。这样 debug:

首先进入 repo 目录的 node_modules/frida,在 scripts/install.js 的第 13 行,将原来的

  execSync('prebuild-install', { stdio: 'inherit' });

改为

  execSync('prebuild-install --verbose', { stdio: 'inherit' });

然后直接在当前目录(frida 目录)执行

yarn

观察输出结果

我这边环境输出结果如下

PS C:\Users\evi0s\test\WMPFDebugger\node_modules\frida> yarn
yarn install v1.22.22
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ node scripts/install.js
prebuild-install info begin Prebuild-install version 7.1.3
prebuild-install info looking for local prebuild @ prebuilds\frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info npm cache directory missing, creating it...
prebuild-install info looking for cached prebuild @ C:\Users\evi0s\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install http request GET https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install http 200 https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info downloading to @ C:\Users\evi0s\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz.192976-7621cd4444d2c.tmp
prebuild-install info renaming to @ C:\Users\evi0s\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info unpacking @ C:\Users\evi0s\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info unpack resolved to C:\Users\evi0s\test\WMPFDebugger\node_modules\frida\build\frida_binding.node
prebuild-install info install Successfully installed prebuilt binary!
Done in 1.71s.

evi0s avatar Sep 26 '25 04:09 evi0s

Image这是执行后的报错信息

1585370420 avatar Sep 26 '25 05:09 1585370420

日志看来还是 mirror 的问题,切换到原来的源然后挂代理呢?

顺便,其实可以单独去 github 下载那个 tar.gz 文件(在我的日志里)然后解压放到 frida 的 build 文件夹下,就可以跳过后面所有的额外步骤了,只需要再去 repo 目录执行一次 yarn 就行

evi0s avatar Sep 26 '25 06:09 evi0s

顺便,frida 那个 package.json 中应该有 binaries 一个键,其中应该可以修改从哪下载 frida 的 binding,但是不确定会不会被源的设置覆盖掉

https://github.com/frida/frida-node/blob/87fd9e475a606eb85ad7d4400b73f1f3670fbfb6/package.json#L78

evi0s avatar Sep 26 '25 06:09 evi0s

好的,我尝试一下

1585370420 avatar Sep 26 '25 06:09 1585370420

顺便,其实可以单独去 github 下载那个 tar.gz 文件(在我的日志里)然后解压放到 frida 的 build 文件夹下,就可以跳过后面所有的额外步骤了,只需要再去 repo 目录执行一次 yarn 就行

具体相关代码:

https://github.com/frida/frida-node/blob/87fd9e475a606eb85ad7d4400b73f1f3670fbfb6/scripts/install.js#L7

只检查了 build 目录有没有 frida_binding.node 这个文件,所以可以手动下载解压放进去

evi0s avatar Sep 26 '25 06:09 evi0s

顺便,其实可以单独去 github 下载那个 tar.gz 文件(在我的日志里)然后解压放到 frida 的 build 文件夹下,就可以跳过后面所有的额外步骤了,只需要再去 repo 目录执行一次 yarn 就行

具体相关代码:

https://github.com/frida/frida-node/blob/87fd9e475a606eb85ad7d4400b73f1f3670fbfb6/scripts/install.js#L7

只检查了 build 目录有没有 frida_binding.node 这个文件,所以可以手动下载解压放进去

已经下载frida_binding.node放到 frida 的 build 文件夹下了, repo 目录执行一次 yarn,完了执行npx ts-node src/index.ts报以下错误

E:\web\git\WMPFDebugger>npx ts-node src/index.ts
E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851
            return old(m, filename);
                   ^
Error [ERR_REQUIRE_ESM]: require() of ES Module E:\web\git\WMPFDebugger\node_modules\frida\build\src\frida.js from E:\web\git\WMPFDebugger\src\index.ts not supported.
Instead change the require of frida.js in E:\web\git\WMPFDebugger\src\index.ts to a dynamic import() which is available in all CommonJS modules.
    at require.extensions.<computed> [as .js] (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851:20)
    at Object.<anonymous> (E:\web\git\WMPFDebugger\src\index.ts:42:28)
    at m._compile (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:857:29) {
  code: 'ERR_REQUIRE_ESM'
}

o0o52lin avatar Oct 11 '25 01:10 o0o52lin

顺便,其实可以单独去 github 下载那个 tar.gz 文件(在我的日志里)然后解压放到 frida 的 build 文件夹下,就可以跳过后面所有的额外步骤了,只需要再去 repo 目录执行一次 yarn 就行

具体相关代码: https://github.com/frida/frida-node/blob/87fd9e475a606eb85ad7d4400b73f1f3670fbfb6/scripts/install.js#L7 只检查了 build 目录有没有 frida_binding.node 这个文件,所以可以手动下载解压放进去

已经下载frida_binding.node放到 frida 的 build 文件夹下了, repo 目录执行一次 yarn,完了执行npx ts-node src/index.ts报以下错误

E:\web\git\WMPFDebugger>npx ts-node src/index.ts
E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851
            return old(m, filename);
                   ^
Error [ERR_REQUIRE_ESM]: require() of ES Module E:\web\git\WMPFDebugger\node_modules\frida\build\src\frida.js from E:\web\git\WMPFDebugger\src\index.ts not supported.
Instead change the require of frida.js in E:\web\git\WMPFDebugger\src\index.ts to a dynamic import() which is available in all CommonJS modules.
    at require.extensions.<computed> [as .js] (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851:20)
    at Object.<anonymous> (E:\web\git\WMPFDebugger\src\index.ts:42:28)
    at m._compile (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:857:29) {
  code: 'ERR_REQUIRE_ESM'
}

需要 Node.js v22 LTS (#61)

evi0s avatar Oct 11 '25 03:10 evi0s

顺便,其实可以单独去 github 下载那个 tar.gz 文件(在我的日志里)然后解压放到 frida 的 build 文件夹下,就可以跳过后面所有的额外步骤了,只需要再去 repo 目录执行一次 yarn 就行

具体相关代码: https://github.com/frida/frida-node/blob/87fd9e475a606eb85ad7d4400b73f1f3670fbfb6/scripts/install.js#L7 只检查了 build 目录有没有 frida_binding.node 这个文件,所以可以手动下载解压放进去

已经下载frida_binding.node放到 frida 的 build 文件夹下了, repo 目录执行一次 yarn,完了执行npx ts-node src/index.ts报以下错误

E:\web\git\WMPFDebugger>npx ts-node src/index.ts
E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851
            return old(m, filename);
                   ^
Error [ERR_REQUIRE_ESM]: require() of ES Module E:\web\git\WMPFDebugger\node_modules\frida\build\src\frida.js from E:\web\git\WMPFDebugger\src\index.ts not supported.
Instead change the require of frida.js in E:\web\git\WMPFDebugger\src\index.ts to a dynamic import() which is available in all CommonJS modules.
    at require.extensions.<computed> [as .js] (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851:20)
    at Object.<anonymous> (E:\web\git\WMPFDebugger\src\index.ts:42:28)
    at m._compile (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:857:29) {
  code: 'ERR_REQUIRE_ESM'
}

需要 Node.js v22 LTS (#61)

确实,切Node.js v22就可以了,谢了

o0o52lin avatar Oct 11 '25 08:10 o0o52lin

顺便,其实可以单独去 github 下载那个 tar.gz 文件(在我的日志里)然后解压放到 frida 的 build 文件夹下,就可以跳过后面所有的额外步骤了,只需要再去 repo 目录执行一次 yarn 就行

具体相关代码: https://github.com/frida/frida-node/blob/87fd9e475a606eb85ad7d4400b73f1f3670fbfb6/scripts/install.js#L7 只检查了 build 目录有没有 frida_binding.node 这个文件,所以可以手动下载解压放进去

已经下载frida_binding.node放到 frida 的 build 文件夹下了, repo 目录执行一次 yarn,完了执行npx ts-node src/index.ts报以下错误

E:\web\git\WMPFDebugger>npx ts-node src/index.ts
E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851
            return old(m, filename);
                   ^
Error [ERR_REQUIRE_ESM]: require() of ES Module E:\web\git\WMPFDebugger\node_modules\frida\build\src\frida.js from E:\web\git\WMPFDebugger\src\index.ts not supported.
Instead change the require of frida.js in E:\web\git\WMPFDebugger\src\index.ts to a dynamic import() which is available in all CommonJS modules.
    at require.extensions.<computed> [as .js] (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851:20)
    at Object.<anonymous> (E:\web\git\WMPFDebugger\src\index.ts:42:28)
    at m._compile (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:857:29) {
  code: 'ERR_REQUIRE_ESM'
}

请问这个frida_binding.node在哪可以下载,tar.gz解压出来的只有源码文件

asaka003 avatar Oct 15 '25 17:10 asaka003

顺便,其实可以单独去 github 下载那个 tar.gz 文件(在我的日志里)然后解压放到 frida 的 build 文件夹下,就可以跳过后面所有的额外步骤了,只需要再去 repo 目录执行一次 yarn 就行

具体相关代码: https://github.com/frida/frida-node/blob/87fd9e475a606eb85ad7d4400b73f1f3670fbfb6/scripts/install.js#L7 只检查了 build 目录有没有 frida_binding.node 这个文件,所以可以手动下载解压放进去

已经下载frida_binding.node放到 frida 的 build 文件夹下了, repo 目录执行一次 yarn,完了执行npx ts-node src/index.ts报以下错误

E:\web\git\WMPFDebugger>npx ts-node src/index.ts
E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851
            return old(m, filename);
                   ^
Error [ERR_REQUIRE_ESM]: require() of ES Module E:\web\git\WMPFDebugger\node_modules\frida\build\src\frida.js from E:\web\git\WMPFDebugger\src\index.ts not supported.
Instead change the require of frida.js in E:\web\git\WMPFDebugger\src\index.ts to a dynamic import() which is available in all CommonJS modules.
    at require.extensions.<computed> [as .js] (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:851:20)
    at Object.<anonymous> (E:\web\git\WMPFDebugger\src\index.ts:42:28)
    at m._compile (E:\web\git\WMPFDebugger\node_modules\ts-node\dist\index.js:857:29) {
  code: 'ERR_REQUIRE_ESM'
}

请问这个frida_binding.node在哪可以下载,tar.gz解压出来的只有源码文件

这个 comment 的日志 https://github.com/evi0s/WMPFDebugger/issues/58#issuecomment-3336758618

evi0s avatar Oct 16 '25 04:10 evi0s

E:\WMPFDebugger>yarn install yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... [1/2] ⠈ frida error E:\WMPFDebugger\node_modules\frida: Command failed. Exit code: 1 Command: node scripts/install.js Arguments: Directory: E:\WMPFDebugger\node_modules\frida Output: prebuild-install warn install aborted Downloading toolchain 20250919... Extracting toolchain... Downloading SDK 20250919 for windows-x86-mt... Extracting SDK... The Meson build system Version: 1.4.99 Source dir: E:\WMPFDebugger\node_modules\frida Build dir: E:\WMPFDebugger\node_modules\frida\build Build type: native build Program python3 found: YES (C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python3.EXE) Project name: frida-node Project version: 17.3.2 C compiler for the host machine: E:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\bin\HostX86\x86\cl.EXE (msvc 19.44.35219 "���� x86 �� Microsoft (R) C/C++ �Ż������� 19.44.35219 ��") C linker for the host machine: link link 14.44.35219.0 Host machine cpu family: x86 Host machine cpu: x86 Program node found: YES (C:\Users\uuuu\AppData\Local\Temp\yarn--1761297825246-0.3297246820409956\node.CMD) Program npm found: YES (E:\nvm4w\nodejs\npm.CMD) Program python3 found: YES (C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python.exe) Message: Fetching ABI bits

meson.build:42:11: ERROR: Command C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python.exe E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py win ia32 C:\Users\uuuu\AppData\Local\Temp\yarn--1761297825246-0.3297246820409956\node.CMD E:\nvm4w\nodejs\npm.CMD E:\WMPFDebugger\node_modules\frida\build failed with status 1.

A full log can be found at E:\WMPFDebugger\node_modules\frida\build\meson-logs\meson-log.txt Command '['C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python.exe', 'E:\WMPFDebugger\node_modules\frida\releng\meson\meson.py', 'setup', '-Dprefix=C:\Program Files\Frida', '-Ddefault_library=static', '-Doptimization=s', '-Db_ndebug=true', '--native-file=E:\WMPFDebugger\node_modules\frida\build\frida-windows-x86-mt.txt', WindowsPath('E:/WMPFDebugger/node_modules/frida/build')]' returned non-zero exit status 1.

执行yarn时会报错。然后E:\WMPFDebugger\node_modules\frida\build\meson-logs的日志报错为: Traceback (most recent call last): File "E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py", line 293, in main(sys.argv) File "E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py", line 40, in main (node_incdirs, node_gypdir, node_libs) = load_dev_assets(gyp_os, gyp_arch, node, outdir, abidir) File "E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py", line 118, in load_dev_assets with urllib.request.urlopen(f"{base_url}{libs_subpath}/node.lib") as response: File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 222, in urlopen return opener.open(url, data, timeout) File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 531, in open response = meth(req, response) File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 640, in http_response response = self.parent.error( File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 569, in error return self._call_chain(*args) File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 502, in _call_chain result = func(*args) File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found

meson.build:42:11: ERROR: Command C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python.exe E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py win ia32 C:\Users\uuuu\AppData\Local\Temp\yarn--1761297216381-0.14963673003253297\node.CMD E:\nvm4w\nodejs\npm.CMD E:\WMPFDebugger\node_modules\frida\build failed with status 1. 这个问题怎么处理呀?我的py版本是3.8.10;node 是22.13.0

qpzzk avatar Oct 24 '25 09:10 qpzzk

E:\WMPFDebugger>yarn install yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... [1/2] ⠈ frida error E:\WMPFDebugger\node_modules\frida: Command failed. Exit code: 1 Command: node scripts/install.js Arguments: Directory: E:\WMPFDebugger\node_modules\frida Output: prebuild-install warn install aborted Downloading toolchain 20250919... Extracting toolchain... Downloading SDK 20250919 for windows-x86-mt... Extracting SDK... The Meson build system Version: 1.4.99 Source dir: E:\WMPFDebugger\node_modules\frida Build dir: E:\WMPFDebugger\node_modules\frida\build Build type: native build Program python3 found: YES (C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python3.EXE) Project name: frida-node Project version: 17.3.2 C compiler for the host machine: E:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\bin\HostX86\x86\cl.EXE (msvc 19.44.35219 "���� x86 �� Microsoft (R) C/C++ �Ż������� 19.44.35219 ��") C linker for the host machine: link link 14.44.35219.0 Host machine cpu family: x86 Host machine cpu: x86 Program node found: YES (C:\Users\uuuu\AppData\Local\Temp\yarn--1761297825246-0.3297246820409956\node.CMD) Program npm found: YES (E:\nvm4w\nodejs\npm.CMD) Program python3 found: YES (C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python.exe) Message: Fetching ABI bits

meson.build:42:11: ERROR: Command C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python.exe E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py win ia32 C:\Users\uuuu\AppData\Local\Temp\yarn--1761297825246-0.3297246820409956\node.CMD E:\nvm4w\nodejs\npm.CMD E:\WMPFDebugger\node_modules\frida\build failed with status 1.

A full log can be found at E:\WMPFDebugger\node_modules\frida\build\meson-logs\meson-log.txt Command '['C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python.exe', 'E:\WMPFDebugger\node_modules\frida\releng\meson\meson.py', 'setup', '-Dprefix=C:\Program Files\Frida', '-Ddefault_library=static', '-Doptimization=s', '-Db_ndebug=true', '--native-file=E:\WMPFDebugger\node_modules\frida\build\frida-windows-x86-mt.txt', WindowsPath('E:/WMPFDebugger/node_modules/frida/build')]' returned non-zero exit status 1.

执行yarn时会报错。然后E:\WMPFDebugger\node_modules\frida\build\meson-logs的日志报错为: Traceback (most recent call last): File "E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py", line 293, in main(sys.argv) File "E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py", line 40, in main (node_incdirs, node_gypdir, node_libs) = load_dev_assets(gyp_os, gyp_arch, node, outdir, abidir) File "E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py", line 118, in load_dev_assets with urllib.request.urlopen(f"{base_url}{libs_subpath}/node.lib") as response: File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 222, in urlopen return opener.open(url, data, timeout) File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 531, in open response = meth(req, response) File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 640, in http_response response = self.parent.error( File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 569, in error return self._call_chain(*args) File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 502, in _call_chain result = func(*args) File "C:\Users\uuuu\AppData\Local\Programs\Python\Python38\lib\urllib\request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found

meson.build:42:11: ERROR: Command C:\Users\uuuu\AppData\Local\Programs\Python\Python38\python.exe E:\WMPFDebugger\node_modules\frida\scripts/fetch-abi-bits.py win ia32 C:\Users\uuuu\AppData\Local\Temp\yarn--1761297216381-0.14963673003253297\node.CMD E:\nvm4w\nodejs\npm.CMD E:\WMPFDebugger\node_modules\frida\build failed with status 1. 这个问题怎么处理呀?我的py版本是3.8.10;node 是22.13.0

参考这个 comment https://github.com/evi0s/WMPFDebugger/issues/58#issuecomment-3336758618

evi0s avatar Oct 24 '25 14:10 evi0s

已经按提示加了--verbose参数,执行后有如下报错:

D:\WMPFDebugger> yarn
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/2] ⡀ frida
error D:\WMPFDebugger\node_modules\frida: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments:
Directory: D:\WMPFDebugger\node_modules\frida
Output:
prebuild-install warn install read ECONNRESET
Downloading toolchain 20250919...
Extracting toolchain...
Downloading SDK 20250919 for windows-x86_64-mt...
Extracting SDK...
The Meson build system
Version: 1.4.99
Source dir: D:\WMPFDebugger\node_modules\frida
Build dir: D:\WMPFDebugger\node_modules\frida\build
Build type: native build
Program python3 found: YES (C:\msys64\mingw64\bin\python3.EXE)
Project name: frida-node
Project version: 17.3.2

meson.build:1:0: ERROR: Compiler C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE cannot compile programs.

A full log can be found at D:\WMPFDebugger\node_modules\frida\build\meson-logs\meson-log.txt
Command '['C:\\ProgramData\\miniforge3\\python.exe', 'D:\\WMPFDebugger\\node_modules\\frida\\releng\\meson\\meson.py', 'setup', '-Dprefix=C:\\Program Files\\Frida', '-Ddefault_library=static', '-Doptimization=s', '-Db_ndebug=true', '--native-file=D:\\WMPFDebugger\\node_modules\\frida\\build\\frida-windows-x86_64-mt.txt', WindowsPath('D:/WMPFDebugger/node_modules/frida/build')]' returned non-zero exit status 1.

日志文件D:\WMPFDebugger\node_modules\frida\build\meson-logs\meson-log.txt中有如下详情内容:

Build started at 2025-10-27T00:27:17.222059
Main binary: C:\ProgramData\miniforge3\python.exe
Build Options: '-Dprefix=C:\Program Files\Frida' -Ddefault_library=static -Doptimization=s -Db_ndebug=true '--native-file=D:\WMPFDebugger\node_modules\frida\build\frida-windows-x86_64-mt.txt'
Python system: Windows
The Meson build system
Version: 1.4.99
Source dir: D:\WMPFDebugger\node_modules\frida
Build dir: D:\WMPFDebugger\node_modules\frida\build
Build type: native build
Program python3 found: YES (C:\msys64\mingw64\bin\python3.EXE)
Running command: C:\msys64\mingw64\bin\python3.EXE D:\WMPFDebugger\node_modules\frida\scripts/detect-version.py
--- stdout ---
17.3.2

--- stderr ---


Project name: frida-node
Project version: 17.3.2
-----------
Detecting compiler via: `"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE" --version` -> 2
stderr:
用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.43.34809 版
版权所有(C) Microsoft Corporation。保留所有权利。

cl: 命令行 warning D9002 :忽略未知选项“--version”
cl: 命令行 error D8003 :缺少源文件名
-----------
Sanity testing C compiler: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE"
Is cross compiler: False.
Sanity check compiler command line: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE" sanitycheckc.c /Fesanitycheckc.exe /MT /GS- /Gy /Zc:inline /fp:fast /nologo /showIncludes /utf-8 /link
Sanity check compile stdout:
sanitycheckc.c
LINK : fatal error LNK1104: 无法打开文件“LIBCMT.lib”

-----
Sanity check compile stderr:

-----

meson.build:1:0: ERROR: Compiler C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE cannot compile programs.

Zyx-A avatar Oct 26 '25 16:10 Zyx-A

已经按提示加了--verbose参数,执行后有如下报错:

D:\WMPFDebugger> yarn yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... [1/2] ⡀ frida error D:\WMPFDebugger\node_modules\frida: Command failed. Exit code: 1 Command: node scripts/install.js Arguments: Directory: D:\WMPFDebugger\node_modules\frida Output: prebuild-install warn install read ECONNRESET Downloading toolchain 20250919... Extracting toolchain... Downloading SDK 20250919 for windows-x86_64-mt... Extracting SDK... The Meson build system Version: 1.4.99 Source dir: D:\WMPFDebugger\node_modules\frida Build dir: D:\WMPFDebugger\node_modules\frida\build Build type: native build Program python3 found: YES (C:\msys64\mingw64\bin\python3.EXE) Project name: frida-node Project version: 17.3.2

meson.build:1:0: ERROR: Compiler C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE cannot compile programs.

A full log can be found at D:\WMPFDebugger\node_modules\frida\build\meson-logs\meson-log.txt Command '['C:\ProgramData\miniforge3\python.exe', 'D:\WMPFDebugger\node_modules\frida\releng\meson\meson.py', 'setup', '-Dprefix=C:\Program Files\Frida', '-Ddefault_library=static', '-Doptimization=s', '-Db_ndebug=true', '--native-file=D:\WMPFDebugger\node_modules\frida\build\frida-windows-x86_64-mt.txt', WindowsPath('D:/WMPFDebugger/node_modules/frida/build')]' returned non-zero exit status 1. 日志文件D:\WMPFDebugger\node_modules\frida\build\meson-logs\meson-log.txt中有如下详情内容:

Build started at 2025-10-27T00:27:17.222059
Main binary: C:\ProgramData\miniforge3\python.exe
Build Options: '-Dprefix=C:\Program Files\Frida' -Ddefault_library=static -Doptimization=s -Db_ndebug=true '--native-file=D:\WMPFDebugger\node_modules\frida\build\frida-windows-x86_64-mt.txt'
Python system: Windows
The Meson build system
Version: 1.4.99
Source dir: D:\WMPFDebugger\node_modules\frida
Build dir: D:\WMPFDebugger\node_modules\frida\build
Build type: native build
Program python3 found: YES (C:\msys64\mingw64\bin\python3.EXE)
Running command: C:\msys64\mingw64\bin\python3.EXE D:\WMPFDebugger\node_modules\frida\scripts/detect-version.py
--- stdout ---
17.3.2

--- stderr ---


Project name: frida-node
Project version: 17.3.2
-----------
Detecting compiler via: `"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE" --version` -> 2
stderr:
用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.43.34809 版
版权所有(C) Microsoft Corporation。保留所有权利。

cl: 命令行 warning D9002 :忽略未知选项“--version”
cl: 命令行 error D8003 :缺少源文件名
-----------
Sanity testing C compiler: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE"
Is cross compiler: False.
Sanity check compiler command line: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE" sanitycheckc.c /Fesanitycheckc.exe /MT /GS- /Gy /Zc:inline /fp:fast /nologo /showIncludes /utf-8 /link
Sanity check compile stdout:
sanitycheckc.c
LINK : fatal error LNK1104: 无法打开文件“LIBCMT.lib”

-----
Sanity check compile stderr:

-----

meson.build:1:0: ERROR: Compiler C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE cannot compile programs.

是要在 frida 那个目录执行,不是项目目录

然后直接在当前目录(frida 目录)执行

evi0s avatar Oct 26 '25 16:10 evi0s

不好意思,没注意执行目录。现在在frida目录下执行后,得到如下报错:

D:\WMPFDebugger\node_modules\frida> yarn
yarn install v1.22.22
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
success Saved lockfile.
$ node scripts/install.js
prebuild-install warn install read ECONNRESET
The Meson build system
Version: 1.4.99
Source dir: D:\WMPFDebugger\node_modules\frida
Build dir: D:\WMPFDebugger\node_modules\frida\build
Build type: native build
Program python3 found: YES (C:\msys64\mingw64\bin\python3.EXE)
Project name: frida-node
Project version: 17.3.2

meson.build:1:0: ERROR: Compiler C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE cannot compile programs.

A full log can be found at D:\WMPFDebugger\node_modules\frida\build\meson-logs\meson-log.txt
Command '['C:\\ProgramData\\miniforge3\\python.exe', 'D:\\WMPFDebugger\\node_modules\\frida\\releng\\meson\\meson.py', 'setup', '-Dprefix=C:\\Program Files\\Frida', '-Ddefault_library=static', '-Doptimization=s', '-Db_ndebug=true', '--native-file=D:\\WMPFDebugger\\node_modules\\frida\\build\\frida-windows-x86_64-mt.txt', WindowsPath('D:/WMPFDebugger/node_modules/frida/build')]' returned non-zero exit status 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

日志文件D:\WMPFDebugger\node_modules\frida\build\meson-logs\meson-log.txt中有如下详情内容:

Build started at 2025-10-27T00:49:47.792623
Main binary: C:\ProgramData\miniforge3\python.exe
Build Options: '-Dprefix=C:\Program Files\Frida' -Ddefault_library=static -Doptimization=s -Db_ndebug=true '--native-file=D:\WMPFDebugger\node_modules\frida\build\frida-windows-x86_64-mt.txt'
Python system: Windows
The Meson build system
Version: 1.4.99
Source dir: D:\WMPFDebugger\node_modules\frida
Build dir: D:\WMPFDebugger\node_modules\frida\build
Build type: native build
Program python3 found: YES (C:\msys64\mingw64\bin\python3.EXE)
Running command: C:\msys64\mingw64\bin\python3.EXE D:\WMPFDebugger\node_modules\frida\scripts/detect-version.py
--- stdout ---
17.3.2

--- stderr ---


Project name: frida-node
Project version: 17.3.2
-----------
Detecting compiler via: `"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE" --version` -> 2
stderr:
用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.43.34809 版
版权所有(C) Microsoft Corporation。保留所有权利。

cl: 命令行 warning D9002 :忽略未知选项“--version”
cl: 命令行 error D8003 :缺少源文件名
-----------
Sanity testing C compiler: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE"
Is cross compiler: False.
Sanity check compiler command line: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE" sanitycheckc.c /Fesanitycheckc.exe /MT /GS- /Gy /Zc:inline /fp:fast /nologo /showIncludes /utf-8 /link
Sanity check compile stdout:
sanitycheckc.c
LINK : fatal error LNK1104: 无法打开文件“kernel32.lib”

-----
Sanity check compile stderr:

-----

meson.build:1:0: ERROR: Compiler C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE cannot compile programs.

Zyx-A avatar Oct 26 '25 16:10 Zyx-A

prebuild-install warn install read ECONNRESET

确认加了 verbose?日志看起来并不是 verbose。顺便这个肯定还是网络问题

evi0s avatar Oct 26 '25 17:10 evi0s

prebuild-install warn install read ECONNRESET

确认加了 verbose?日志看起来并不是 verbose。顺便这个肯定还是网络问题

感谢答疑。还真是网络问题,我重新强制走代理,就能正确下载并安装了。 另外附下此前的报错日志,也给其他兄弟一个参考。

  • 未强制代理前的报错信息:
D:\WMPFDebugger\node_modules\frida> yarn
yarn install v1.22.22
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ node scripts/install.js
prebuild-install info begin Prebuild-install version 7.1.3
prebuild-install info looking for local prebuild @ prebuilds\frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\Lyx\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install http request GET https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install http 200 https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info downloading to @ C:\Users\Lyx\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz.29920-3a93f64f40ab9.tmp
prebuild-install warn install aborted
The Meson build system
Version: 1.4.99
Source dir: D:\WMPFDebugger\node_modules\frida
Build dir: D:\WMPFDebugger\node_modules\frida\build
Build type: native build
Program python3 found: YES (C:\msys64\mingw64\bin\python3.EXE)
Project name: frida-node
Project version: 17.3.2

meson.build:1:0: ERROR: Compiler C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64\cl.EXE cannot compile programs.

A full log can be found at D:\WMPFDebugger\node_modules\frida\build\meson-logs\meson-log.txt
Command '['C:\\ProgramData\\miniforge3\\python.exe', 'D:\\WMPFDebugger\\node_modules\\frida\\releng\\meson\\meson.py', 'setup', '-Dprefix=C:\\Program Files\\Frida', '-Ddefault_library=static', '-Doptimization=s', '-Db_ndebug=true', '--native-file=D:\\WMPFDebugger\\node_modules\\frida\\build\\frida-windows-x86_64-mt.txt', WindowsPath('D:/WMPFDebugger/node_modules/frida/build')]' returned non-zero exit status 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
  • 强制代理后的执行结果:
D:\WMPFDebugger\node_modules\frida> D:\proxychains\proxychains_win32_x64.exe -f D:\proxychains\proxychains.conf yarn
yarn install v1.22.22
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ node scripts/install.js
prebuild-install info begin Prebuild-install version 7.1.3
prebuild-install info looking for local prebuild @ prebuilds\frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\Lyx\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install http request GET https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz
[PID14600] [I] 2025/10/27 10:51:00 <> localhost:1080
[PID14600] [I] 2025/10/27 10:51:00 Mswsock.dll (FP)ConnectEx(860 224.134.132.83:443 16) -> github.com:443 PROXY
[PID14600] [I] 2025/10/27 10:51:00 <> localhost:1080
[PID14600] [I] 2025/10/27 10:51:00 Mswsock.dll (FP)ConnectEx(892 224.20.187.15:443 16) -> release-assets.githubusercontent.com:443 PROXY
prebuild-install http 200 https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info downloading to @ C:\Users\Lyx\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz.14600-94f7ee946537b.tmp
prebuild-install info renaming to @ C:\Users\Lyx\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info unpacking @ C:\Users\Lyx\AppData\Roaming\npm-cache\_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz
prebuild-install info unpack resolved to D:\WMPFDebugger\node_modules\frida\build\frida_binding.node
prebuild-install info install Successfully installed prebuilt binary!
Done in 28.14s.
[I] 2025/10/27 10:51:27 All Windows descendant process exited.
[I] 2025/10/27 10:51:27 Master exiting
(base) PS D:\WMPFDebugger\node_modules\frida> cd ./../..
(base) PS D:\WMPFDebugger> yarn
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 3.56s.

Zyx-A avatar Oct 27 '25 02:10 Zyx-A

prebuild-install warn install read ECONNRESET

确认加了 verbose?日志看起来并不是 verbose。顺便这个肯定还是网络问题

C:\Users\tiantian\Desktop\WMPFDebugger-main\node_modules\frida>yarn yarn install v1.22.22 info No lockfile found. [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... [4/5] Linking dependencies... [5/5] Building fresh packages...

success Saved lockfile. $ node scripts/install.js prebuild-install info begin Prebuild-install version 7.1.3 prebuild-install info looking for local prebuild @ prebuilds\frida-v17.3.2-napi-v8-win32-x64.tar.gz prebuild-install info looking for cached prebuild @ C:\Program Files\nodejs\node_cache_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz prebuild-install http request GET https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz prebuild-install http 200 https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz prebuild-install info downloading to @ C:\Program Files\nodejs\node_cache_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz.12532-bcab42b10eeb2.tmp prebuild-install warn install aborted Visual Studio is not installed error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. 加了verbose返回这个错误

maidou0627 avatar Nov 11 '25 14:11 maidou0627

prebuild-install warn install read ECONNRESET

确认加了 verbose?日志看起来并不是 verbose。顺便这个肯定还是网络问题

C:\Users\tiantian\Desktop\WMPFDebugger-main\node_modules\frida>yarn yarn install v1.22.22 info No lockfile found. [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... [4/5] Linking dependencies... [5/5] Building fresh packages...

success Saved lockfile. $ node scripts/install.js prebuild-install info begin Prebuild-install version 7.1.3 prebuild-install info looking for local prebuild @ prebuilds\frida-v17.3.2-napi-v8-win32-x64.tar.gz prebuild-install info looking for cached prebuild @ C:\Program Files\nodejs\node_cache_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz prebuild-install http request GET https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz prebuild-install http 200 https://github.com/frida/frida/releases/download/17.3.2/frida-v17.3.2-napi-v8-win32-x64.tar.gz prebuild-install info downloading to @ C:\Program Files\nodejs\node_cache_prebuilds\cf6dbc-frida-v17.3.2-napi-v8-win32-x64.tar.gz.12532-bcab42b10eeb2.tmp prebuild-install warn install aborted Visual Studio is not installed error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. 加了verbose返回这个错误

看起来是没下完中断了,应该还是网络问题

evi0s avatar Nov 12 '25 04:11 evi0s

Image 这个问题有知道怎么解决的吗

zimu61 avatar Nov 13 '25 13:11 zimu61

Image 这个问题有知道怎么解决的吗

https://github.com/evi0s/WMPFDebugger/issues/58#issuecomment-3336758618

evi0s avatar Nov 13 '25 14:11 evi0s

顺便,其实可以单独去 github 下载那个 tar.gz 文件(在我的日志里)然后解压放到 frida 的 build 文件夹下,就可以跳过后面所有的额外步骤了,只需要再去 repo 目录执行一次 yarn 就行

具体相关代码:

https://github.com/frida/frida-node/blob/87fd9e475a606eb85ad7d4400b73f1f3670fbfb6/scripts/install.js#L7

只检查了 build 目录有没有 这个文件,所以可以手动下载解压放进去frida_binding.node

frida_binding.node在哪下载

God-Myw avatar Dec 22 '25 09:12 God-Myw