0

Visual Studio 2019 does not discover napi.hunless I use relative paths while opening a npm project as a folder. The file is located in node_modules/node-addon-api/napi.h. How can I force VS to find this header? Is there an Additional include directory type option when opening a folder?

The header is automatically discovered on my laptop with the same version of VS2019 and the same environment path. I have nodejs tools installed for Visual Studio.

I want to be able to do #include <napi.h> and have the header discovered. At the moment I must do #include "../node_modules/node-addon-api/napi.h"

user3238415
  • 188
  • 1
  • 11
  • 1
    I don't exactly understand your question. I think you just need to modify your "Additional include directory" setting for your project. There is also a system wide version of that but unless you want to use this header in every project its best to use the per project version. – drescherjm Jun 19 '19 at 12:10
  • @drescherjm Thanks for the post. I'm not opening a project, I'm opening a folder and I cannot find such a option when opening a regular folder – user3238415 Jun 19 '19 at 12:39
  • You could use the system wide setting in your IDE compiler settings. I don't have 2019 installed here so I can't point you through the menus to the setting, – drescherjm Jun 19 '19 at 12:41

0 Answers0