Node.js 17 headers problem
See original GitHub issueIn Node.js 17.0.0 an header is missing and this cause the following error during the compilation of a C++ addon.
In file included from ../node_modules/nan/nan.h:58:
In file included from /var/folders/b1/nkhppp291574ww7ftwplz6t80000gn/T/prebuild/node/17.0.0/include/node/node.h:63:
In file included from /var/folders/b1/nkhppp291574ww7ftwplz6t80000gn/T/prebuild/node/17.0.0/include/node/v8.h:25:
In file included from /var/folders/b1/nkhppp291574ww7ftwplz6t80000gn/T/prebuild/node/17.0.0/include/node/v8-array-buffer.h:13:
In file included from /var/folders/b1/nkhppp291574ww7ftwplz6t80000gn/T/prebuild/node/17.0.0/include/node/v8-object.h:10:
/var/folders/b1/nkhppp291574ww7ftwplz6t80000gn/T/prebuild/node/17.0.0/include/node/v8-persistent-handle.h:10:10: fatal error: 'v8-weak-callback-info.h' file not found
#include "v8-weak-callback-info.h" // NOLINT(build/include_directory)
This was a known problem and was solved in version 17.0.1; so, in order to solve this compilation error, this row should be changed to: "target": "17.0.1"
.
In fact, forcing prebuild to use source of Node.js 17.0.1, the compilation succeeds:
$ npx prebuild -r node -t 17.0.1 --force --strip --tag-prefix ""
prebuild info begin Prebuild version 11.0.0
prebuild info build Preparing to prebuild @matteodisabatino/gc_info@1.1.0 for node 17.0.1 on darwin-x64 using node-gyp
prebuild info find Python using Python version 3.10.0 found at "/usr/local/opt/python@3.10/bin/python3.10"
prebuild http GET https://nodejs.org/dist/v17.0.1/node-v17.0.1-headers.tar.gz
prebuild http 200 https://nodejs.org/dist/v17.0.1/node-v17.0.1-headers.tar.gz
prebuild http GET https://nodejs.org/dist/v17.0.1/SHASUMS256.txt
prebuild http 200 https://nodejs.org/dist/v17.0.1/SHASUMS256.txt
(node:9457) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
prebuild info spawn /usr/local/opt/python@3.10/bin/python3.10
prebuild info spawn args [
prebuild info spawn args '/Users/matteodisabatino/Work/repos/gc_info/node_modules/node-gyp/gyp/gyp_main.py',
prebuild info spawn args 'binding.gyp',
prebuild info spawn args '-Dmodule_name=gc_info',
prebuild info spawn args '-f',
prebuild info spawn args 'make',
prebuild info spawn args '-I',
prebuild info spawn args '/Users/matteodisabatino/Work/repos/gc_info/build/config.gypi',
prebuild info spawn args '-I',
prebuild info spawn args '/Users/matteodisabatino/Work/repos/gc_info/node_modules/node-gyp/addon.gypi',
prebuild info spawn args '-I',
prebuild info spawn args '/var/folders/b1/nkhppp291574ww7ftwplz6t80000gn/T/prebuild/node/17.0.1/include/node/common.gypi',
prebuild info spawn args '-Dlibrary=shared_library',
prebuild info spawn args '-Dvisibility=default',
prebuild info spawn args '-Dnode_root_dir=/var/folders/b1/nkhppp291574ww7ftwplz6t80000gn/T/prebuild/node/17.0.1',
prebuild info spawn args '-Dnode_gyp_dir=/Users/matteodisabatino/Work/repos/gc_info/node_modules/node-gyp',
prebuild info spawn args '-Dnode_lib_file=/var/folders/b1/nkhppp291574ww7ftwplz6t80000gn/T/prebuild/node/17.0.1/<(target_arch)/node.lib',
prebuild info spawn args '-Dmodule_root_dir=/Users/matteodisabatino/Work/repos/gc_info',
prebuild info spawn args '-Dnode_engine=v8',
prebuild info spawn args '--depth=.',
prebuild info spawn args '--no-parallel',
prebuild info spawn args '--generator-output',
prebuild info spawn args 'build',
prebuild info spawn args '-Goutput_dir=.'
prebuild info spawn args ]
prebuild info spawn make
prebuild info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/gc_info/src/gc_info.o
CXX(target) Release/obj.target/gc_info/src/event.o
CXX(target) Release/obj.target/gc_info/src/heap_stats.o
CXX(target) Release/obj.target/gc_info/src/gc_stats.o
SOLINK_MODULE(target) Release/gc_info.node
prebuild info build Stripping debug information from build/Release/gc_info.node
prebuild info build Packing build/Release/gc_info.node into prebuilds/@matteodisabatino/gc_info-v1.1.0-node-v102-darwin-x64.tar.gz
prebuild info build Prebuild written to prebuilds/@matteodisabatino/gc_info-v1.1.0-node-v102-darwin-x64.tar.gz
If you want I can provide a pull request.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Missing header file v8-weak-callback-info.h in v17 #40529
The expected behavior is that v8-weak-callback-info.h is included in the headers file that is obtained by node-gyp from https://nodejs.org/ ...
Read more >Not able to access request Headers in node.js server
Express doesn't have any req.header () . You will have to use req.get(field) as specified in the express documentation.
Read more >Node.js HTTP: ERR_HTTP_HEADERS_SENT - Airbrake Blog
According to the Node.js docs, an ERR_HTTP_HEADERS_SENT is “an attempt made to add more headers after the headers [have] already been sent.”.
Read more >Node v17.0.0 (Current)
js 17, it's likely that your application or a module you're using is attempting to use an algorithm or key size which is...
Read more >node-fetch - npm
// fetch-polyfill.js import fetch, { Blob, blobFrom, blobFromSync, File, fileFrom, fileFromSync, FormData, Headers, Request, Response, } from ' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@matteodisabatino The ABI registry is auto generated, manually editing the registry will be reverted within ~30 minutes by our automation. @VerteDinde if there is an issue with the registry we’ll need to update the script not the JSON file
🎉 This issue has been resolved in version 3.4.1 🎉
The release is available on:
Your semantic-release bot 📦🚀