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

Compile error in Node V12.* #206

Closed
alkan opened this issue Jun 25, 2019 · 6 comments · Fixed by #211
Closed

Compile error in Node V12.* #206

alkan opened this issue Jun 25, 2019 · 6 comments · Fixed by #211
Assignees
Labels

Comments

@alkan
Copy link

alkan commented Jun 25, 2019

We get the following error while installing the package>

gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/ayhan/devtools/node-12.4.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:200:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Linux 4.15.0-52-generic gyp ERR! command "/home/ayhan/devtools/node-12.4.0/bin/node" "/home/ayhan/devtools/node-12.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/ayhan/projects/matriks/dev/work/nnw/node_modules/nanomsg gyp ERR! node -v v12.4.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok n

@nickdesaulniers
Copy link
Owner

thanks for the report @alkan . Can you provide the full error logs? Otherwise the report provided just looks like gyp ERR! repeated again and again without any meaningful errors with which to go on.

Also, how did you invoke the build?

@enjoy05sky
Copy link

Use Vue-Cli install nanomsg4.0.2 .My nodejs version is v12.0.0

..\src\node_nanomsg.cc(102): error C2664: 'v8::String::Utf8Value::Utf8Value(const v8::String::Utf8Value &)': cannot convert argument 1 from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value &' [F:\ali-project\Kratos\node_modules\nanomsg\build\node_nanomsg.vcxproj] ..\src\node_nanomsg.cc(102): note: Reason: cannot convert from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value' ..\src\node_nanomsg.cc(102): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called f:\ali-project\kratos\node_modules\nanomsg\node_modules\nan\nan_object_wrap.h(24): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [F:\ali-project\Kratos\node_modules\nanomsg\build\node_nanomsg.vcxproj] with [ T=v8::Object ] (compiling source file ..\src\poll_ctx.cc) F:\ali-project\Kratos\node_modules\nanomsg\node_modules\nan\nan.h(1579): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' with [ T=v8::Object ] (compiling source file ..\src\poll_ctx.cc) f:\ali-project\kratos\node_modules\nanomsg\node_modules\nan\nan_object_wrap.h(67): warning C4996: 'v8::PersistentBase<v8::Object>::MarkIndependent': was declared deprecated (compiling source file ..\src\poll_ctx.cc) [F:\ali-project\Kratos\node_modules\nanomsg\build\node_nanomsg.vcxproj] c:\users\bin\.node-gyp\12.0.0\include\node\v8.h(563): note: see declaration of 'v8::PersistentBase<v8::Object>::MarkIndependent' (compiling source file ..\src\poll_ctx.cc) f:\ali-project\kratos\node_modules\nanomsg\node_modules\nan\nan_object_wrap.h(124): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' [F:\ali-project\Kratos\node_modules\nanomsg\build\node_nanomsg.vcxproj] with [ T=v8::Object ] (compiling source file ..\src\poll_ctx.cc) F:\ali-project\Kratos\node_modules\nanomsg\node_modules\nan\nan.h(1579): note: see declaration of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits<T>>' with [ T=v8::Object ] (compiling source file ..\src\poll_ctx.cc) gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\bin\AppData\Roaming\nvm\v12.0.0\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:196:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12) gyp ERR! System Windows_NT 10.0.17134 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bin\\AppData\\Roaming\\nvm\\v12.0.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd F:\ali-project\Kratos\node_modules\nanomsg gyp ERR! node -v v12.0.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok

@nickdesaulniers
Copy link
Owner

There are 2 errors in @enjoy05sky 's report:

  1. 'v8::String::Utf8Value::Utf8Value(const v8::String::Utf8Value &)': cannot convert argument 1 from 'v8::Localv8::Value' to 'const v8::String::Utf8Value &' is referring to
    String::Utf8Value str(info[1]);
    .
  2. 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits>' is an error within nan.

I don't understand how either of the two would fail to compile, and just on windows, unless the version of nan we're using has known issues (just on Windows in nodejs v12) or changed somehow.

Looks like we're using nan 2.8.

"nan": "2.8"

Most recent version is 2.14. https://www.npmjs.com/package/nan

We could probably try to upgrade our version of nan. Ah, looking at nan's issue tracker, nodejs/nan#849 (comment) references the above.

Also, this likely slipped passed us because the latest version of nodejs in our issue tracker is v9 (so we haven't been testing v12): https://github.com/nickdesaulniers/node-nanomsg/blob/master/.travis.yml

@nickdesaulniers nickdesaulniers self-assigned this Jun 30, 2019
@nickdesaulniers
Copy link
Owner

Indeed, I just install node 12.5 and can repro on Linux, so this has nothing to do Windows specifically.

nickdesaulniers added a commit that referenced this issue Jun 30, 2019
- upgrade nan to v2.14
- use  Nan::Utf8String rather than v8::String::Utf8Value

Fixes #206
nickdesaulniers added a commit that referenced this issue Jul 2, 2019
* support node v12
- upgrade nan to v2.14
- use  Nan::Utf8String rather than v8::String::Utf8Value

Fixes #206

* fix 1 of the 2 Nan::Callback::Call deprecation warnings

Looks like the Nan::Callback::Call() API deprecated bare calls that
don't pass a new Nan::AsyncResource().  Luckily, in this case we were
already subclassing Nan::AsyncWorker, which has a member named
`async_resource` so all we have to do is explicitly pass this along.

I wonder if Nan should just do this for me? *hmm*

Bug #209
@nickdesaulniers
Copy link
Owner

we still need to publish a version with the fix

@reqshark
Copy link
Collaborator

reqshark commented Jul 2, 2019

we still need to publish a version with the fix

done! we just cutv4.1.0

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

Successfully merging a pull request may close this issue.

4 participants