Node.js > 16 fails on Windows#270
Conversation
Recommendations: * Do not run `npm test` * macOS and Ubuntu: Node.js v20.x and Python 3.12 * Windows: Node.js v16.x and Python 3.11 -- Do not run `node-gyp rebuild` Lessons learned: 1. Node.js >= v21 fails 2. Node.js >= 18 fails on Windows 3. Python >= 3.12 fails on Node.js 16 because of distlib fixed in node-gyp v10.0 4. `npm test` fails with: npm ERR! Missing script: "test" 5. `node-gyp rebuild` fails on Node.js 16
|
try and referenced nodejs patch: Basically, any spawn of .cmd or .bat needs the shell:true option. |
|
With the above changes,, on windows, using node 22, tests work for node-ffi-napi, node-ref-napi, and ref-struct-ci, and they all then work together in my windows-root-certs once modified (which uses ref-struct and node-ffi to read a complex windows API from Cyrpto32.dll). I was giving up hope, but does not seem too bad :). out of interest, does appveyer test on OSX and linux? - I'll need the 'set' to work on all :( but my OSX machine is probably too old to build on now. |
|
Any updates on this? |
|
Did you try the alternatives mentioned in |
|
i did not, just switched to Node 16 using nvm. I couldn't change module to use another as advised in this issue, because i had this problem with Vosk, that has this in the dependencies and not ffi-napi itself |
* Bump version to 4.0.5 Upstream fixes present: - libffi.gyp: correct preprocess_asm.cmd path for Windows (node-ffi-napi#293, node-ffi-napi#265) - src/ffi.cc: remove NAPI_EXPERIMENTAL define (node-ffi-napi#283) - node-gyp-build bumped to ^4.8.2, prebuildify to ^6.0.1 (node-ffi-napi#283) - Supported on node 22 (Linux/Mac/Windows/Mingw) node-ffi-napi#281 node-ffi-napi#270 * Add MinGW (MSYS2 MINGW64) build and test job Uses MSYS2's own Node.js package so os.type() returns MINGW64_NT-*, which activates the MinGW code path in libffi.gyp (GCC compiles .S files directly instead of the MSVC preprocess_asm.cmd route). * Improve MSYS2 detection * Use MSYSTEM_PREFIX to detect MSYS2 toolchain instead of MSYSTEM * Skip uv_fs_open symbol check on MinGW/MSYS2 Windows builds On MSYS2 MinGW nodes, libuv is not necessarily re-exported from the node binary, so GetProcAddress("uv_fs_open") returns error 127. The test still verifies that Library(null, {}) succeeds on MinGW; only the MSVC-specific symbol export assumption is skipped.



Test results: https://github.com/cclauss/node-ffi-napi/actions
Recommendations:
npm testnode-gyp rebuildLessons learned:
distlibfixed in node-gyp v10.0npm testfails withnpm ERR! Missing script: "test"node-gyp rebuildfails on Node.js 16