Skip to content

Instantly share code, notes, and snippets.

@pascaliske
Last active June 14, 2019 07:14
Show Gist options
  • Save pascaliske/3312101bd6c50fdf464ec2dcf997bb57 to your computer and use it in GitHub Desktop.
Save pascaliske/3312101bd6c50fdf464ec2dcf997bb57 to your computer and use it in GitHub Desktop.
Angular v8 // Serve CPU Usage

Angular v8 // High CPU Usage

The v8 update of Angular needs at least Node.js version v12+ but the library fsevents which will be hoisted in version v1.2.4 from the cli isn't compatible with v12+ yet.

$ yarn why fsevents
yarn why v1.16.0
[1/4] 🤔  Why do we have the module "fsevents"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "fsevents@1.2.7"
info Has been hoisted to "fsevents"
info Reasons this module exists
   - Hoisted from "@angular#compiler-cli#chokidar#fsevents"
   - Hoisted from "@angular-devkit#build-angular#webpack-dev-server#chokidar#fsevents"
=> Found "chokidar#fsevents@1.2.4"
info This module exists because "chokidar" depends on it.
✨  Done in 0.55s.

The solution to this is to specify a explicit version resolution in your package.json file to v1.2.9 which is compatible with Node.js v12+ and the Angular CLI. Afterwards yarn will now always resolve to fsevents@1.2.9.

{
  "resolutions": {
    "fsevents": "1.2.9"
  }
}

Note: npm does not natively support resolutions but this package aims to solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment