Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed: "error: use of undeclared identifier 'napi_create_number'; did you mean 'napi_create_symbol'?" #4

Open
divan opened this issue Nov 20, 2017 · 1 comment

Comments

@divan
Copy link

divan commented Nov 20, 2017

Hi,

I'm trying to create a project with this generator and getting this error:

> node-gyp rebuild

  SOLINK_MODULE(target) Release/nothing.node
  CXX(target) Release/obj.target/napi-test-native/src/napi_test.o
In file included from ../src/napi_test.cc:1:
In file included from ../src/napi_test.h:3:
In file included from /Users/divan/src/test/napi/node_modules/node-addon-api/napi.h:1439:
/Users/divan/src/test/napi/node_modules/node-addon-api/napi-inl.h:415:24: error: use of undeclared
      identifier 'napi_create_number'; did you mean 'napi_create_symbol'?
  napi_status status = napi_create_number(env, val, &value);
                       ^~~~~~~~~~~~~~~~~~
                       napi_create_symbol
/Users/divan/.node-gyp/8.9.1/include/node/node_api.h:156:25: note: 'napi_create_symbol' declared here
NAPI_EXTERN napi_status napi_create_symbol(napi_env env,
                        ^
In file included from ../src/napi_test.cc:1:
In file included from ../src/napi_test.h:3:
In file included from /Users/divan/src/test/napi/node_modules/node-addon-api/napi.h:1439:
/Users/divan/src/test/napi/node_modules/node-addon-api/napi-inl.h:415:48: error: cannot initialize a
      parameter of type 'napi_value' (aka 'napi_value__ *') with an lvalue of type 'double'
  napi_status status = napi_create_number(env, val, &value);
                                               ^~~
/Users/divan/.node-gyp/8.9.1/include/node/node_api.h:157:55: note: passing argument to parameter
      'description' here
                                           napi_value description,
                                                      ^

full output here:
https://gist.github.com/divan/fce9d79fcfe2c7460802ade0ca9af983

Node version 8.9.1

Please, let me know if I need to provide more information about system to reproduce this.

@digitalinfinity
Copy link
Owner

Apologies for the poor experience @divan- I hadn't kept this module up-to-date with new N-API changes, but there is a PR from @andreek that should probably resolve your issues. I'll be reviewing and testing that PR today and if all goes well, I'll have a new version of the module published today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants