nickdesaulniers/node-nanomsg

Compile error in Node V12.*

alkan opened this issue · 6 comments

alkan commented

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

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?

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

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

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

we still need to publish a version with the fix

we still need to publish a version with the fix

done! we just cutv4.1.0