Some examples fail on msys2/mingw
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cmake, cpp, nodejs
- Domain
- build-system, operating-systems, tooling
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- C++
- Stars
- 2.6k
- Forks
- 602
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nodejs/node-addon-examples
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 38/100
nodejs/node-addon-examples#585 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
nodejs/node-addon-examples#530 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 32/100
nodejs/node-addon-examples#444 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
nodejs/node-addon-examples#381 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
nodejs/node-addon-examples#380 · 2 comments ·
All issues in nodejs/node-addon-examples
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·