Bug 1195164 - nodejs-devel doesn't work with node-gyp
nodejs-devel doesn't work with node-gyp
Status: NEW
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Adam Majer
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-26 17:24 UTC by Andreas Schneider
Modified: 2022-01-27 14:22 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schneider 2022-01-26 17:24:21 UTC
If you want to consume nodejs16-devel with a node-gyp project so it can use the headers it doesn't work:

export npm_config_nodedir=/usr/include/node16
node-gyp ...

This gives e.g. the following error:

make: Entering directory '/tmp/signal-desktop-1Tah1oUK/Signal-Desktop-5.29.0/node_modules/fs-xattr/build'
  CC(target) Release/obj.target/xattr/src/async.o
In file included from ../src/async.c:6:
../src/error.h:5:10: fatal error: node_api.h: No such file or directory
    5 | #include <node_api.h>
      |  

node-gyp reads /usr/include/node16/common.gypi

If I add -I/usr/include/node16 to the cflags for linux, it is able to find the headers.
Comment 1 dziobian 2022-01-27 09:46:05 UTC
I had success using `--prefix=/usr/include/node16` instead:

https://build.opensuse.org/package/view_file/home:dziobian:gulgul-ultron/bitwarden/bitwarden.spec?expand=1