From 70bf08073d099074c65ecc0ddb474b4b1a063236 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Mon, 25 Jun 2018 19:30:37 +0000 Subject: Resolve "100% CPU for webpack-dev-server running in GDK" --- scripts/frontend/postinstall.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/frontend/postinstall.js (limited to 'scripts/frontend') diff --git a/scripts/frontend/postinstall.js b/scripts/frontend/postinstall.js new file mode 100644 index 00000000000..682039a41b3 --- /dev/null +++ b/scripts/frontend/postinstall.js @@ -0,0 +1,22 @@ +const chalk = require('chalk'); + +// check that fsevents is available if we're on macOS +if (process.platform === 'darwin') { + try { + require.resolve('fsevents'); + } catch (e) { + console.error(`${chalk.red('error')} Dependency postinstall check failed.`); + console.error( + chalk.red(` + The fsevents driver is not installed properly. + If you are running a new version of Node, please + ensure that it is supported by the fsevents library. + + You can try installing again with \`${chalk.cyan('yarn install --force')}\` + `) + ); + process.exit(1); + } +} + +console.log(`${chalk.green('success')} Dependency postinstall check passed.`); -- cgit v1.2.1