Skip to content

namespace "Napi" has no member class "Addon" #801

@JKKGBE

Description

@JKKGBE

At 3.0.0 I'm unable to follow addon.md due to Addon missing. The message comes from Visual Studio Code.

When building with node-gyp I also get:

.cpp:5:34: error: expected template-name before ‘<’ token
    5 | class ExampleAddon : public Napi::Addon<ExampleAddon>
      |                                        ^
.cpp:5:34: error: expected ‘{’ before ‘<’ token
.cpp:5:34: error: expected unqualified-id before ‘<’ token
.cpp:28:22: error: expected constructor, destructor, or type conversion at end of input
   28 | NODE_API_ADDON(ExampleAddon)
      |                            ^

What am I missing here? hello example is working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions