LoginSignup
0
0

More than 3 years have passed since last update.

node v12でのnode-gyp rebuildでのエラー

Last updated at Posted at 2020-04-28

環境

macOS Catalina(10.15.4)
node.js v12.16.2

発生した問題

gatsby newをしようとしたところ以下のようなエラーが発生。

error /Users/gedyra/blog/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: /Users/gedyra/blog/node_modules/sharp
Output:
info sharp Using cached /Users/gedyra/.npm/_libvips/libvips-8.7.0-darwin-x64.tar.gz
(中略)
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: warning: 'ToBoolean' is deprecated: ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations]
X(Boolean)
(省略)
/Users/gedyra/Library/Caches/node-gyp/12.16.2/include/node/v8.h:2663:3: note: 'ToBoolean' has been explicitly marked deprecated here
  V8_DEPRECATED(\"ToBoolean can never throw. Use Local version.\",
(省略)

解決策

どうやらnode v12では、すでにdeprecatedだったいくつかの関数が削除された模様。
https://kokufu.blogspot.com/2019/11/node-ffi-node-12.html

nvm use lts/dubniumなどでnode v10以下を使えば解決しました。
https://github.com/nodejs/node-gyp/issues/1941

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0