Closed binary-blazer closed 1 year ago
As far as I can tell you are trying to compile re2
on Node 20 and getting an error from node-gyp
, which is a required dependency of any binary node extension:
npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>'
npm ERR! gyp ERR! stack at createConfigFile (C:\Users\janjy\OneDrive\Desktop\GiveAways API\node_modules\node-gyp\lib\configure.js:117:21)
npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
It is likely node-gyp
installed on that computer is too old and does not support Node 20:
npm ERR! gyp ERR! node -v v20.0.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
The current version at the time of this writing is 9.3.1 (see https://www.npmjs.com/package/node-gyp).
Another possible concern can be the version of VS:
npm ERR! gyp info find VS using VS2019 (16.11.33529.622) found at:
My advice would be to update other related software when upgrading Node. Generally node-gyp
should explicitly support a Node version because APIs and corresponding C++ headers change with every version.
So i tried to update my node-gyp to the latest version now, the error did not got fixed and the version of VS is the latest and i already tried to repair it with the "Repair Visual Studio" button.
What should i do now? Should i try to downgrade to nodejs v18?
I don't really know. Every time I commit a Github action builds the project on all supported platforms and run tests. To wit: https://github.com/uhop/node-re2/actions/runs/5082834983
You can inspect the command-line output of any job — they usually print out their exact configuration. You can see how it is different with your setup.
I got it. It was a issue with a npm package i had in my package.json. im still wondering why this Error happened now because im using this package since i think 1 year and i never had issues. I removed the package and after that it installed everything without any issue.
Hello! When i run the
npm install --legacy-peer-deps
command it seems to try to install the npm packages defined in the package.json file. But it ends in a error and the error message includes the node-re2 package so im asking if you guys can help me. the error is below: