Skip to content

Conversation

@cclauss
Copy link

@cclauss cclauss commented Mar 29, 2024

Test results: https://github.com/cclauss/node-ffi-napi/actions

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

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
@cclauss cclauss changed the title Node.js > 16 failes on Windows Node.js > 16 fails on Windows Mar 29, 2024
@btsimonh
Copy link

try
"node-gyp-build": "^4.2.1", -> "node-gyp-build": "^4.8.2",
A security patch in nodejs messed with all late nodejs versions and node-gyp:

nodejs/node#52554

and referenced nodejs patch:

https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2

Basically, any spawn of .cmd or .bat needs the shell:true option.

@cclauss
Copy link
Author

cclauss commented Oct 23, 2024

"node-gyp-build": "^4.2.1",

@btsimonh Unfortunately the AppVeyor Windows tests continue to fail on Node.js > v16.

@btsimonh
Copy link

ok, remove the .lock file - should it be comitted?
Also, I changed:
image
(I found this on some other repo).
image
(got this from you?)
and
image
(i don't know if prebuildify made a difference).

There was a change to a .h, but maybe I lost it and it was not important, maybe a warning only.

@btsimonh
Copy link

btsimonh commented Oct 23, 2024

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.

@amolinarius
Copy link

Any updates on this?
I would really like to see this PR merged because i have the same problem on Win11 with node 22.12.0 (stable)

@cclauss
Copy link
Author

cclauss commented Dec 28, 2024

Did you try the alternatives mentioned in

@amolinarius
Copy link

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
Thanks anyway and happy new year ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants