sapegin / grunt-webfont

SVG to webfont converter for Grunt
MIT License
1.11k stars 210 forks source link

Update ttf2woff2 to v3 for Node v12 + support #394

Open jleiva opened 5 years ago

jleiva commented 5 years ago

Hi! When installing grunt-webfont in Node v12 there are some errors.

I'm using:

Node v12.0.0 npm v6.9.0 node-gyp -v v3.8.0

According to ttf2woff2 this was fixed in https://github.com/nfroidure/ttf2woff2/releases/tag/v3.0.0

Error ``

ttf2woff2@2.0.3 install /Users/jdleiva/Workspaces/bc-frontend/public/node_modules/ttf2woff2 (node-gyp rebuild > builderror.log) || (exit 0)

../csrc/addon.cc:10:40: error: no matching member function for call to 'ToObject' Local inputBuffer = info[0]->ToObject();


/Users/jdleiva/.node-gyp/12.0.0/include/node/v8.h:2532:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
/Users/jdleiva/.node-gyp/12.0.0/include/node/v8.h:2546:35: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
                    Local<Object> ToObject(Isolate* isolate) const);
                                  ^
1 error generated.
make: *** [Release/obj.target/addon/csrc/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/jdleiva/.nvm/versions/node/v12.0.0/lib/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 Darwin 17.7.0
gyp ERR! command "/Users/jdleiva/.nvm/versions/node/v12.0.0/bin/node" "/Users/jdleiva/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jdleiva/Workspaces/bc-frontend/public/node_modules/ttf2woff2
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
``
wglas85 commented 5 years ago

I double this request, please update npm dependencies in grunt-webfont, because we get a lot of deprecation warnings and are unable to build our projects with NodeJS v12. Thanks in Advance, Wolfgang

yokuze commented 4 years ago

I'm also encountering these errors. Please consider this issue, and #408

pbredenberg commented 4 years ago

Would love to see #408 get merged. It seems like the outdated packages in this project are causing node-gyp to choke and fail to set execution environment bindings. Subsequent packages that rely on native add-ons (like node-sass) during npm install don't compile either.

Further research will be required to prove that point, but using the fork from @jleider resolves build errors I'm experiencing in one of my projects.