Some examples fail on msys2/mingw

Offen
#445 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
cmake, cpp, nodejs

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
C++
Sterne
2.6k
Forks
598
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nodejs/node-addon-examples

Alle Issues in nodejs/node-addon-examples

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.