summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-06-25 19:30:37 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-06-25 19:30:37 +0000
commit70bf08073d099074c65ecc0ddb474b4b1a063236 (patch)
tree738dc42e3560e5fca36eb1b2b9cc5c24afe3ff04 /scripts
parent45453c27ae63a7445d31e7a5ef92ebb74c0b0094 (diff)
downloadgitlab-ce-70bf08073d099074c65ecc0ddb474b4b1a063236.tar.gz
Resolve "100% CPU for webpack-dev-server running in GDK"
Diffstat (limited to 'scripts')
-rw-r--r--scripts/frontend/postinstall.js22
1 files changed, 22 insertions, 0 deletions
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.`);