nfroidure / ttf2woff2

Convert ttf files to woff2.
MIT License
297 stars 39 forks source link

Install failed after update to node 12, could nan require to v.14? #57

Closed zuo305 closed 3 years ago

zuo305 commented 4 years ago

Recently I update my node to 12, here is environment list: Node v12.13.0 Npm v6.12.0 ttf2woff2 v3.0.0 I already installed "windows-build-tools"

This is the error message: "gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\john.zuo\AppData\Roaming\nvm\v12.13.0\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:210:5) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) gyp ERR! System Windows_NT 10.0.18362 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\john.zuo\AppData\Roaming\nvm\v12.13.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" gyp ERR! cwd C:\Dev\CCL\Website\Trunk\CCL.Website\node_modules\ttf2woff2 gyp ERR! node -v v12.13.0 gyp ERR! node-gyp -v v5.0.5"

The most strange thing is that I tried to make another clean Angular project and install ttf2woff2, it is successful.

I compared the two project's node_module, I found something:

In the failed project, there are some files missing, they are: addon.exp, addon.ilk,addon.lib,addon.node,addon.pdb and addon.obj, etc.

And in the builderror.log file, there are some errors: ...... c:\dev\ccl\website\trunk\ccl.website\node_modules\nan\nan.h(1063): error C2661: 'v8::Value::ToString': no overloaded function takes 0 arguments (compiling source file ..\csrc\addon.cc) [C:\Dev\CCL\Website\Trunk\CCL.Website\node_modules\ttf2woff2\build\addon.vcxproj] c:\dev\ccl\website\trunk\ccl.website\node_modules\nan\nan.h(1073): error C2664: 'int v8::String::WriteUtf8(v8::Isolate ,char ,int,int ,int) const': cannot convert argument 1 from 'char ' to 'v8::Isolate *' (compiling source file ..\csrc\addon.cc) [C:\Dev\CCL\Website\Trunk\CCL.Website\node_modules\ttf2woff2\build\addon.vcxproj] ...... c:\dev\ccl\website\trunk\ccl.website\node_modules\nan\nan_object_wrap.h(124): error C2039: 'IsNearDeath': is not a member of 'Nan::Persistent<v8::Object,v8::NonCopyablePersistentTraits>' [C:\Dev\CCL\Website\Trunk\CCL.Website\node_modules\ttf2woff2\build\addon.vcxproj] with [ T=v8::Object ] (compiling source file ..\csrc\addon.cc)

......

Sorry, I think I already got the reason, the reason is that the failed project is using an old Nan lib v.10.

I guess if ttf2woff2 update to require "nan"v.14 will be better.

Thank you very much.

seyfer commented 4 years ago

I have the same issue but in Debian docker container. Does not build with node 12

In file included from ../../nan/nan_new.h:189:0,
                 from ../../nan/nan.h:203,
                 from ../csrc/addon.cc:1:
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Function>::return_t Nan::imp::Factory<v8::Function>::New(Nan::FunctionCallback, v8::Local<v8::Value>)’:
../../nan/nan_implementation_12_inl.h:105:32: error: no matching function for call to ‘v8::Function::New(v8::Isolate*&, void (&)(const v8::FunctionCallbackInfo<v8::Value>&), v8::Local<v8::Object>&)’
                           , obj));
seyfer commented 4 years ago

this is the related issue https://github.com/nodejs/nan/issues/849

easy to fix by installing nan@^2.14.0

arochettesteinberg commented 4 years ago

@zuo305 I'm having the same problem than you here on Win10. Have you been able to figure this out by any chance?

andersk commented 3 years ago

ttf2woff2@4.0.0 now depends nan@^2.14.2. Perhaps this can be closed?