こんがりぃ

都内在住フリーランスのエンジニア。主にRuby on Rails。Twitter(@Kongari_Bug)で格ゲー。

yarn install 中の node-sass エラー

make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/vagrant/rails/yuyuyui/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.15.0-20-generic
gyp ERR! command "/usr/local/bin/node" "/home/vagrant/rails/yuyuyui/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/vagrant/rails/yuyuyui/node_modules/node-sass
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1

nodeのバージョンの問題らしい

nodeのバージョンを 10.6.0 -> 9.0.0 にしたら治った。9.0.0は別の環境と揃えただけのバージョンなので良いバージョンを探すと良さそう。