node-gyp build problems with @sapphire/type
Trying to install @sapphire/type, bufferutil or other native libraries fails on my windows machine.
Visual studio throws syntax errors parsing the node includes.
The problem does not occur with clang on my linux machine.
As vs22 is the recommend version for node-gyp 10.1.0, I'm puzzled what the error might be,
however I have no direct experience with node modules in this sense.
Node Version: v22.1.0
node-gyp Version: 10.1.0
Python Version: Python 3.12.3
VS Version: 17.9.6 Enterprise with C++ Desktop Development workload
Solution:Jump to solution
Issue link: https://github.com/nodejs/nan/issues/968
GitHub
Can't compile simple program on Windows with Node.js 22 · Issue #96...
With nan 2.19, a barebones simple program fails to compile on Windows. Attached is the full program (zipped). To test the failure: unzip nantest.zip Run npm install If compilation is successful, yo...
37 Replies
Downgrade back to Node 20. This often happens when you try to be on the cutting edge versions. It appears that Node 22 broke something with the lib.
CC @kyra 🩵🩷🤍🩷🩵 and @vladdy because it's the C code.
woooo useless errors 🥴
it should also be noted that we haven't even updated our CI yet to build for Node 22. It's barely been released too, only for a little over a week. It's never wise to be on such cutting edge releases. Always let versions of things like Node, Python, etc settle, give it a few months, then update
also it built just fine on mac on node 22
lets see what ci says
.../node_modules/@sapphire/type install: <string>:13: SyntaxWarning: invalid escape sequence '\$'
wtf22.0.0 or 22.1.0?
22.0.0
i can jump to 22.1
just downgraded to 22.0.0, that also works on windows
FASCINATING
it..built
with more warnings
but it built
too slow favna
too slow
i already opened the PR :CLk_Kekega:
says the guy who didnt update all three files
idc
:meguFace:
also wdym 3 files
did find-and-replace abandon your sanity
i literally checked all workflows :dead:
wtf
you forgot to update release-updater.yml
this some bullllllshit
also
anyways idk why it doesnt build cuz like...locally it built fine
inb4 yet another windows moment
GH wont have 22.1.0 yet for sure
since it released literally today
It does
lol
and it looks to be a non-us issue
since the error comes from
oh github is actually fast for a change
need i remind you github doesnt need to do anything as we rely on setup-node which fetches from the registry?
look at the URL
pretty sure it has fallbacks
red on Windows 2019 Node 22: https://github.com/sapphiredev/type/actions/runs/8946191937/job/24576424990?pr=557
yeah but not our fault
and Windows 2022 Node 22: https://github.com/sapphiredev/type/actions/runs/8946191937/job/24576425292?pr=557
seems like its something to do with windows and node 22
which :shrug:
so that confirms the issue anyway @fantasy
guess ill have to stick with the 22.0.0 then
or...
20
which is still LTS for a while
._.
wheres the fun if it were to just work :^)
it seems like node encountered some v8 bugs too
its
fun
this is why you dont rush new majors :KEKW:
https://github.com/nodejs/node/pull/52794 fixes it, but im still searching where it was introduced
GitHub
build: define
NOMINMAX
in common.gypi by legendecas · Pull Reques...V8 and Node.js had defined NOMINMAX on Windows for a long time. In
recent changes, V8 added std::numeric_limits::min usages in its
header files which caused addons without NOMINMAX defines failed
...
Solution
Issue link: https://github.com/nodejs/nan/issues/968
GitHub
Can't compile simple program on Windows with Node.js 22 · Issue #96...
With nan 2.19, a barebones simple program fails to compile on Windows. Attached is the full program (zipped). To test the failure: unzip nantest.zip Run npm install If compilation is successful, yo...
(so i can accept an answer that gets updated)
zlib-sync still broken with 22.0.0, lts it is then