Some examples fail on msys2/mingw

未關閉
#445 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
cmake, cpp, nodejs

研究方向

Start by reproducing the failing npm install in src/8-tooling/build_with_cmake/napi or node-addon-api under MSYS2/MinGW, using the reported cmake-js and Visual Studio errors. Compare this with the other listed cmake-js examples and identify where the toolchain is selected. Done means the affected examples install successfully with MinGW without requiring Visual Studio.

由索引模型根據 Issue 內容生成。

描述

It is quite fortunate that most examples run, Here are all the tests:

passed: C:\a\node-addon-examples\src\1-getting-started\1_hello_world\nan
passed: C:\a\node-addon-examples\src\1-getting-started\1_hello_world\napi
passed: C:\a\node-addon-examples\src\1-getting-started\1_hello_world\node-addon-api
passed: C:\a\node-addon-examples\src\1-getting-started\1_hello_world\node-addon-api-addon-class
passed: C:\a\node-addon-examples\src\1-getting-started\2_function_arguments\nan
passed: C:\a\node-addon-examples\src\1-getting-started\2_function_arguments\napi
passed: C:\a\node-addon-examples\src\1-getting-started\2_function_arguments\node-addon-api
passed: C:\a\node-addon-examples\src\1-getting-started\3_callbacks\nan
passed: C:\a\node-addon-examples\src\1-getting-started\3_callbacks\napi
passed: C:\a\node-addon-examples\src\1-getting-started\3_callbacks\node-addon-api
passed: C:\a\node-addon-examples\src\1-getting-started\4_object_factory\nan
passed: C:\a\node-addon-examples\src\1-getting-started\4_object_factory\napi
passed: C:\a\node-addon-examples\src\1-getting-started\4_object_factory\node-addon-api
passed: C:\a\node-addon-examples\src\1-getting-started\5_function_factory\nan
passed: C:\a\node-addon-examples\src\1-getting-started\5_function_factory\napi
passed: C:\a\node-addon-examples\src\1-getting-started\5_function_factory\node-addon-api
passed: C:\a\node-addon-examples\src\1-getting-started\6_object_wrap\nan
passed: C:\a\node-addon-examples\src\1-getting-started\6_object_wrap\napi
passed: C:\a\node-addon-examples\src\1-getting-started\6_object_wrap\node-addon-api
passed: C:\a\node-addon-examples\src\1-getting-started\7_factory_wrap\nan
passed: C:\a\node-addon-examples\src\1-getting-started\7_factory_wrap\napi
passed: C:\a\node-addon-examples\src\1-getting-started\7_factory_wrap\node-addon-api
passed: C:\a\node-addon-examples\src\1-getting-started\a-first-project\node-addon-api
passed: C:\a\node-addon-examples\src\2-js-to-native-conversion\8_passing_wrapped\nan
passed: C:\a\node-addon-examples\src\2-js-to-native-conversion\8_passing_wrapped\napi
passed: C:\a\node-addon-examples\src\2-js-to-native-conversion\8_passing_wrapped\node-addon-api
passed: C:\a\node-addon-examples\src\2-js-to-native-conversion\array_buffer_to_native\node-addon-
api
passed: C:\a\node-addon-examples\src\2-js-to-native-conversion\object-template-demo\nan
passed: C:\a\node-addon-examples\src\2-js-to-native-conversion\object-template-demo\napi
passed: C:\a\node-addon-examples\src\2-js-to-native-conversion\object-wrap-demo\node-addon-api
passed: C:\a\node-addon-examples\src\2-js-to-native-conversion\typed_array_to_native\node-addon-a
pi
passed: C:\a\node-addon-examples\src\3-context-awareness\napi
passed: C:\a\node-addon-examples\src\3-context-awareness\node_10
passed: C:\a\node-addon-examples\src\5-async-work\async_pi_estimate\nan
passed: C:\a\node-addon-examples\src\5-async-work\async_pi_estimate\node-addon-api
passed: C:\a\node-addon-examples\src\5-async-work\async_work_promise\napi
passed: C:\a\node-addon-examples\src\5-async-work\async_work_promise\node-addon-api
passed: C:\a\node-addon-examples\src\5-async-work\async_work_thread_safe_function\napi
passed: C:\a\node-addon-examples\src\5-async-work\call-js-from-async-worker-execute\node-addon-ap
i
passed: C:\a\node-addon-examples\src\5-async-work\napi-asyncworker-example\node-addon-api
passed: C:\a\node-addon-examples\src\6-threadsafe-function\promise-callback-demo\node-addon-api
passed: C:\a\node-addon-examples\src\6-threadsafe-function\thread_safe_function_round_trip\napi
passed: C:\a\node-addon-examples\src\7-events\emit_event_from_cpp\node-addon-api
passed: C:\a\node-addon-examples\src\7-events\inherits_from_event_emitter\node-addon-api
failed to install:
    C:\a\node-addon-examples\src\4-references-and-handle-scope\function-reference-demo\node-addon
-api
    C:\a\node-addon-examples\src\5-async-work\async-iterator\node-addon-api
    C:\a\node-addon-examples\src\6-threadsafe-function\threadsafe-async-iterator\node-addon-api
    C:\a\node-addon-examples\src\6-threadsafe-function\thread_safe_function_counting\node-addon-a
pi
    C:\a\node-addon-examples\src\6-threadsafe-function\thread_safe_function_with_object_wrap\node
-addon-api
    C:\a\node-addon-examples\src\6-threadsafe-function\typed_threadsafe_function\node-addon-api
    C:\a\node-addon-examples\src\8-tooling\build_with_cmake\napi
    C:\a\node-addon-examples\src\8-tooling\build_with_cmake\node-addon-api
    C:\a\node-addon-examples\src\8-tooling\typescript_with_addon\node-addon-api

But everything relying on cmake-js refuses to ackownledge the existence of mingw compiler. There are many benefits to using mingw compilers. Besides, they are open source!

testing: C:\a\node-addon-examples\src\8-tooling\build_with_cmake\node-addon-api
ERR! find VS
ERR! find VS msvs_version not set from command line or npm config
ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
ERR! find VS not looking for VS2015 as it is only supported up to Node.js 18
ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
ERR! find VS
ERR! find VS **************************************************************
ERR! find VS You need to install the latest version of Visual Studio
ERR! find VS including the "Desktop development with C++" workload.
ERR! find VS For more information consult the documentation at:
ERR! find VS https://github.com/nodejs/node-gyp#on-windows
ERR! find VS **************************************************************
ERR! find VS
ERR! OMG Could not find any Visual Studio installation to use
ERR! OMG Could not find any Visual Studio installation to use
npm ERR! code 1
npm ERR! path C:\a\node-addon-examples\src\8-tooling\build_with_cmake\node-addon-api
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c cmake-js compile

npm ERR! A complete log of this run can be found in: C:\Users\topkek\AppData\Local\npm-cache\_logs\2024-03-23T14_50_50_859Z-debug-0.log
Error: Command failed: npm install
ERR! find VS
ERR! find VS msvs_version not set from command line or npm config
ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
ERR! find VS not looking for VS2015 as it is only supported up to Node.js 18
ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
ERR! find VS
ERR! find VS **************************************************************
ERR! find VS You need to install the latest version of Visual Studio
ERR! find VS including the "Desktop development with C++" workload.
ERR! find VS For more information consult the documentation at:
ERR! find VS https://github.com/nodejs/node-gyp#on-windows
ERR! find VS **************************************************************
ERR! find VS
ERR! OMG Could not find any Visual Studio installation to use
ERR! OMG Could not find any Visual Studio installation to use
npm ERR! code 1
npm ERR! path C:\a\node-addon-examples\src\8-tooling\build_with_cmake\node-addon-api
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c cmake-js compile
主要語言
C++
星號
2.6k
分支
602
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

nodejs/node-addon-examples 的其他 Issue

查看 nodejs/node-addon-examples 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。