Module build failed: ModuleBuildError: Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (72) を解決する

タイトルのような見たことのないエラーが出たのでしらべたところ、こちらのサイトでrebuildするといいという記事があったので、やってみた。

npm rebuild node-scss

再構築が進むんだけど、結果、以下のようなエラーが表示されました。

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio17\BuildTools\MSBuild.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\nkd\Documents\vagrant\laravel-project\mytasks\node_modules\node-gyp\lib\build.js:262: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\\nkd\\Documents\\vagrant\\laravel-project\\mytasks\\node_modules\\node-gyp\\bin\\node-gyp.js""rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=""--libsass_library="
gyp ERR! cwd C:\Users\nkd\Documents\vagrant\laravel-project\mytasks\node_modules\node-sass
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.10.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.10.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

先日、nodeとnpmのバージョンをあげたことが原因かなぁと思いながら、node-scssのgithubページを確認してみるとnode 12.13.1に対応するnode-scssは4.12系にする必要があるとのことがわかりました。

npm i node-sass@4.12.0

を発行するしてnode-scssを更新するとエラーがなくなりました。