nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
22.72k stars 2.27k forks source link

migration from nx7 to nx8 fails #1764

Closed reimer-atb closed 4 years ago

reimer-atb commented 4 years ago

Expected Behavior

Successful migration from nx7 to nx8 following the official migration guide

Current Behavior

Migration fails in third step when running ng update @nrwl/workspace@8.4.8 with the following error message:

added 48 packages from 37 contributors, removed 2 packages, updated 44 packages and audited 880474 packages in 18.51s
found 16060 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
    ** Executing migrations for package '@nrwl/cypress' **
            Cypress has been updated to a version that improves network speed by 300%!

            Additionally, this resolves an issue where '@types/jquery' needed to be temporarily included in your 'package.json'.
            If you're not using '@types/jquery' in your project otherwise, you may now remove it from your 'devDependencies'.
Invalid rule result: Instance of class Promise.

Same error when using latest release 8.4.12 instead iof 8.4.8.

Failure Information (for bugs)

Steps to Reproduce

  1. run ng update @nrwl/schematics@8.4.8
  2. run git commit -a -m "migrate to nx8"
  3. run ng update @nrwl/workspace@8.4.8

Context

Please provide any relevant information about your setup:

Failure Logs

$ ng update @nrwl/workspace@8.4.8 
Using package manager: 'npm'
Collecting installed dependencies...
Found 41 dependencies.
Fetching dependency metadata from registry...
    Updating package.json with dependency @nrwl/workspace @ "8.4.8" (was "8.0.0")...
    Updating package.json with dependency @nrwl/jest @ "8.4.8" (was "8.0.0")...
    Updating package.json with dependency @nrwl/cypress @ "8.4.8" (was "8.0.0")...
    Updating package.json with dependency @nrwl/angular @ "8.4.8" (was "8.0.0")...
UPDATE package.json (2639 bytes)
npm WARN @angular/compiler-cli@8.0.3 requires a peer of @angular/compiler@8.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.5.0 requires a peer of @angular/compiler@>=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.5.0 requires a peer of @angular/core@>=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 163 packages from 76 contributors, updated 14 packages and audited 880428 packages in 16.035s
found 16061 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
    ** Executing migrations for package '@nrwl/angular' **
UPDATE package.json (2640 bytes)

> core-js@3.1.4 postinstall /home/reimer/driver-ui/node_modules/@angular-devkit/build-angular/node_modules/core-js
> node scripts/postinstall || echo "ignore"

> @angular/cli@8.1.1 postinstall /home/reimer/driver-ui/node_modules/@angular/cli
> node ./bin/postinstall/script.js

npm WARN @angular/compiler-cli@8.0.3 requires a peer of @angular/compiler@8.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.5.0 requires a peer of @angular/compiler@>=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@4.5.0 requires a peer of @angular/core@>=2.3.1 <8.0.0 || >7.0.0-beta <8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 48 packages from 37 contributors, removed 2 packages, updated 44 packages and audited 880474 packages in 18.51s
found 16060 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
    ** Executing migrations for package '@nrwl/cypress' **
            Cypress has been updated to a version that improves network speed by 300%!

            Additionally, this resolves an issue where '@types/jquery' needed to be temporarily included in your 'package.json'.
            If you're not using '@types/jquery' in your project otherwise, you may now remove it from your 'devDependencies'.
Invalid rule result: Instance of class Promise.

Other

package.json:

{
  "name": "driver-ui",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build:bundle": "ng build --prod --output-hashing none --single-bundle true --verbose",
    "test": "ng test",
    "lint": "./node_modules/.bin/nx lint && ng lint",
    "e2e": "ng e2e",
    "affected:apps": "./node_modules/.bin/nx affected:apps",
    "affected:libs": "./node_modules/.bin/nx affected:libs",
    "affected:build": "./node_modules/.bin/nx affected:build",
    "affected:e2e": "./node_modules/.bin/nx affected:e2e",
    "affected:test": "./node_modules/.bin/nx affected:test",
    "affected:lint": "./node_modules/.bin/nx affected:lint",
    "affected:dep-graph": "./node_modules/.bin/nx affected:dep-graph",
    "affected": "./node_modules/.bin/nx affected",
    "format": "./node_modules/.bin/nx format:write",
    "format:write": "./node_modules/.bin/nx format:write",
    "format:check": "./node_modules/.bin/nx format:check",
    "update": "ng update @nrwl/schematics",
    "update:check": "ng update",
    "workspace-schematic": "./node_modules/.bin/nx workspace-schematic",
    "dep-graph": "./node_modules/.bin/nx dep-graph",
    "help": "./node_modules/.bin/nx help"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.15",
    "@angular/common": "^7.2.15",
    "@angular/compiler": "^7.2.15",
    "@angular/core": "^7.2.15",
    "@angular/forms": "^7.2.15",
    "@angular/platform-browser": "^7.2.15",
    "@angular/platform-browser-dynamic": "^7.2.15",
    "@angular/router": "^7.2.15",
    "core-js": "^2.5.4",
    "rxjs": "6.5.1",
    "zone.js": "^0.8.26",
    "@angular/cdk": "^7.3.7",
    "@angular/elements": "^7.2.15",
    "@angular/flex-layout": "^7.0.0-beta.24",
    "@angular/material": "^7.3.7",
    "@aspnet/signalr": "^1.1.2",
    "hammerjs": "^2.0.8",
    "document-register-element": "^1.7.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "7.3.9",
    "@angular/compiler-cli": "~7.2.15",
    "@angular/language-service": "^7.2.15",
    "@nrwl/builders": "7.8.5",
    "@nrwl/schematics": "7.8.5",
    "@types/jest": "24.0.9",
    "@types/jquery": "3.3.6",
    "@types/node": "~8.9.4",
    "@webcomponents/webcomponentsjs": "^2.2.7",
    "codelyzer": "~4.5.0",
    "cypress": "^3.3.1",
    "dotenv": "6.2.0",
    "jest": "24.1.0",
    "jest-preset-angular": "^7.1.1",
    "ngx-build-plus": "^7.8.3",
    "prettier": "1.15.2",
    "ts-jest": "24.0.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "3.2.4"
  }
}
vsavkin commented 4 years ago

Thank you for submitting the issue!

@philipreimer could you provide a repository with the before state?

reimer-atb commented 4 years ago

@vsavkin driver-ui.zip

evtk commented 4 years ago

stumbled across the same problem and updating @angular-devkit/schematics solved my problem!

reimer-atb commented 4 years ago

@EvtK could you elaborate how you updated @angular-devkit/schematics? Did you add it as a direct dependency to your nx workspace? Or did you update one of the dependencies that have @angular-devkit/schematics as a transitive dependency?

evtk commented 4 years ago

Sure, I had it as dev dependency already, so I simply updated it to the latest version with an npm i.

reimer-atb commented 4 years ago

@EvtK thanks, after runningnpm i --save-dev @angular-devkit/schematics migrating to nx8 seesm to complete without any errors

dsebastien commented 4 years ago

The migration also failed for me because of the schematics. I've noticed though that the update script of NX didn't update it along with @angular-devkit/build-angular. It might be nice to also upgrade @angular-devkit/schematics so that both remain aligned?

brandonroberts commented 4 years ago

I verified that the migration works if you first update @angular-devkit/schematics to >= 8.1.1. We don't want to pin the version for the package in the package.json, as it already has a direct dependency with the Angular CLI. I'll look at a fix to update the version before running the migration so it can continue successfully.

jaysoo commented 4 years ago

Closing this since there hasn't been any activity in a while.

reimer-atb commented 4 years ago

Please re-open.

The issue has not been fixed. One still needs to run npm i --save-dev @angular-devkit/schematics@8.... before the update.

But this workaround is not even mentioned in the official update guide.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.