nrwl / nx

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

Migration failure #2674

Closed GaramNick closed 3 years ago

GaramNick commented 4 years ago

Upgrading our nx project fails on both nx migrate @nrwl/workspace@9.1.2 and nx migrate @nrwl/workspace@9.1.2 --from="@nrwl/workspace@8.6.0"

Fetching meta data about packages.
It may take a few minutes.
Invalid Version: null
/home/user/CODE/oper-client-workspace/node_modules/yargs/yargs.js:1109
      else throw err
           ^

Error: Command failed: ./node_modules/.bin/tao migrate @nrwl/workspace@9.1.2
    at checkExecSyncError (child_process.js:611:11)
    at Object.execSync (child_process.js:647:15)
    at Object.handler (/home/user/CODE/oper-client-workspace/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:90:21)
    at Object.runCommand (/home/user/CODE/oper-client-workspace/node_modules/yargs/lib/command.js:235:44)
    at Object.parseArgs [as _parseArgs] (/home/user/CODE/oper-client-workspace/node_modules/yargs/yargs.js:1022:30)
    at Object.get [as argv] (/home/user/CODE/oper-client-workspace/node_modules/yargs/yargs.js:965:21)
    at Object.<anonymous> (/home/user/CODE/oper-client-workspace/node_modules/@nrwl/cli/bin/nx.js:40:26)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 25424,
  stdout: null,
  stderr: null
}

package.json:

{
  "name": "oper-client",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "nx": "nx",
    "start": "ng serve -c=local",
    "start:remote": "ng serve -c=default --proxy-config=proxy-dev.conf.json",
    "build": "ng build",
    "build:production": "ng build --prod",
    "test": "ng test",
    "lint": "nx workspace-lint && ng lint",
    "e2e": "ng e2e",
    "affected:apps": "nx affected:apps",
    "affected:libs": "nx affected:libs",
    "affected:build": "nx affected:build",
    "affected:e2e": "nx affected:e2e",
    "affected:test": "nx affected:test",
    "affected:lint": "nx affected:lint",
    "affected:dep-graph": "nx affected:dep-graph",
    "affected": "nx affected",
    "format": "nx format:write",
    "format:write": "nx format:write",
    "format:check": "nx format:check",
    "update": "ng update @nrwl/workspace",
    "update:check": "ng update",
    "workspace-schematic": "nx workspace-schematic",
    "dep-graph": "nx dep-graph",
    "help": "nx help"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.1.0",
    "@angular-material-extensions/google-maps-autocomplete": "^4.0.1",
    "@angular/animations": "^9.0.6",
    "@angular/cdk": "^9.1.3",
    "@angular/common": "^9.0.6",
    "@angular/compiler": "^9.0.6",
    "@angular/core": "^9.0.6",
    "@angular/flex-layout": "^9.0.0-beta.29",
    "@angular/forms": "^9.0.6",
    "@angular/material": "^9.1.3",
    "@angular/material-moment-adapter": "^9.1.3",
    "@angular/platform-browser": "^9.0.6",
    "@angular/platform-browser-dynamic": "^9.0.6",
    "@angular/router": "^9.0.6",
    "@auth0/angular-jwt": "^3.0.1",
    "@ngrx/effects": "8.3.0",
    "@ngrx/entity": "8.3.0",
    "@ngrx/router-store": "8.3.0",
    "@ngrx/store": "8.3.0",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "@nrwl/angular": "8.6.0",
    "@nrwl/nx": "^7.8.7",
    "@sentry/browser": "^5.14.2",
    "@types/googlemaps": "^3.39.2",
    "core-js": "^2.6.11",
    "crypto-js": "^4.0.0",
    "ngx-mat-select-search": "^2.1.2",
    "rxjs": "~6.5.4",
    "saturn-datepicker": "^8.0.5",
    "zone.js": "^0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.900.6",
    "@angular/cli": "9.0.5",
    "@angular/compiler-cli": "^9.0.6",
    "@angular/language-service": "^9.0.6",
    "@ngrx/schematics": "8.3.0",
    "@ngrx/store-devtools": "8.3.0",
    "@nrwl/cypress": "8.6.0",
    "@nrwl/jest": "8.6.0",
    "@nrwl/workspace": "8.6.0",
    "@types/jest": "24.0.9",
    "@types/node": "~8.9.4",
    "codelyzer": "~5.0.1",
    "cypress": "3.4.1",
    "dotenv": "6.2.0",
    "eslint": "6.1.0",
    "jest": "24.1.0",
    "jest-preset-angular": "^8.1.2",
    "prettier": "1.18.2",
    "ts-jest": "24.0.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.7.5"
  }
}
GaramNick commented 4 years ago

Might be related to https://github.com/nrwl/nx/issues/2653

bojancai commented 4 years ago

sam error encountered

nx migrate @nrwl/worksapce@8.12.11 --from="@nrwl/workspace@8.6.0"

or

nx migrate @nrwl/workspace@8.12.11

or

nx migrate @nrwl/workspace@~8.12.0
Fetching meta data about packages.
It may take a few minutes.
Fetching @nrwl/workspace@~8.12.0
Fetching @angular-devkit/architect@0.803.23
Fetching @angular-devkit/build-angular@0.803.23
Fetching @angular-devkit/build-ng-packagr@0.803.23
Fetching @angular-devkit/build-webpack@0.803.23
Fetching @angular-devkit/build-optimizer@0.803.23
Fetching @angular-devkit/schematics@8.3.23
Fetching @angular/cli@8.3.23
Fetching @schematics/angular@8.3.23
Fetching @nrwl/angular@undefined
Fetching @nrwl/cypress@undefined
Fetching @nrwl/jest@undefined
Fetching @nrwl/tao@undefined
ENOENT: no such file or directory, open '/var/folders/66/bdvy7l9x0ssd7sf8chk6ctww0000gn/T/tmp-55015ABwuD454C3GP/node_modules/@angular/cli/@schematics/angular/migrations/migration-collection.json'
/Users/boliang/Repository/idealx/node_modules/yargs/yargs.js:1109
      else throw err
           ^

Error: Command failed: ./node_modules/.bin/tao migrate @nrwl/workspace@~8.12.0
    at checkExecSyncError (child_process.js:621:11)
    at Object.execSync (child_process.js:657:15)
    at Object.handler (/Users/boliang/Repository/idealx/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:99:21)
    at Object.runCommand (/Users/boliang/Repository/idealx/node_modules/yargs/lib/command.js:235:44)
    at Object.parseArgs [as _parseArgs] (/Users/boliang/Repository/idealx/node_modules/yargs/yargs.js:1022:30)
    at Object.get [as argv] (/Users/boliang/Repository/idealx/node_modules/yargs/yargs.js:965:21)
    at Object.initLocal (/Users/boliang/Repository/idealx/node_modules/@nrwl/cli/lib/init-local.js:18:26)
    at Object.<anonymous> (/Users/boliang/Repository/idealx/node_modules/@nrwl/cli/bin/nx.js:9:18)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 55015,
  stdout: null,
  stderr: null
}
nx migrate @nrwl/workspace 
Fetching meta data about packages.
It may take a few minutes.
Fetching @nrwl/workspace@latest
Fetching @angular-devkit/architect@~0.901.0
Fetching @angular-devkit/build-angular@~0.901.0
Fetching @angular-devkit/build-ng-packagr@~0.901.0
Fetching @angular-devkit/build-webpack@~0.901.0
Fetching @angular-devkit/build-optimizer@~0.901.0
Fetching @angular-devkit/schematics@~9.1.0
Fetching @angular/cli@~9.1.0
Fetching @schematics/angular@~9.1.0
Fetching typescript@~3.8.3
Fetching @angular-devkit/core@~9.1.0
Fetching eslint@6.8.0
Fetching prettier@2.0.4
Fetching tslint@6.0.0
Fetching @ngrx/store@9.1.0
Fetching @ngrx/effects@9.1.0
Fetching @ngrx/entity@9.1.0
Fetching @ngrx/router-store@9.1.0
Fetching @ngrx/schematics@9.1.0
Fetching @ngrx/store-devtools@9.1.0
Fetching rxjs@~6.5.4
Fetching @angular/core@~9.1.0
Fetching @angular/common@~9.1.0
Fetching @angular/forms@~9.1.0
Fetching @angular/compiler@~9.1.0
Fetching @angular/compiler-cli@~9.1.0
Fetching @angular/platform-browser@~9.1.0
Fetching @angular/platform-browser-dynamic@~9.1.0
Fetching @angular/router@~9.1.0
Fetching @angular/language-service@~9.1.0
Fetching @angular/animations@~9.1.0
Fetching @nrwl/angular@undefined
Fetching @nrwl/cypress@undefined
Fetching @nrwl/jest@undefined
Fetching @nrwl/tao@undefined
ENOENT: no such file or directory, open '/var/folders/66/bdvy7l9x0ssd7sf8chk6ctww0000gn/T/tmp-55674XRgRElpauWj8/node_modules/@angular/cli/@schematics/angular/migrations/migration-collection.json'
/Users/boliang/Repository/idealx/node_modules/yargs/yargs.js:1109
      else throw err
           ^

Error: Command failed: ./node_modules/.bin/tao migrate @nrwl/workspace
    at checkExecSyncError (child_process.js:621:11)
    at Object.execSync (child_process.js:657:15)
    at Object.handler (/Users/boliang/Repository/idealx/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:99:21)
    at Object.runCommand (/Users/boliang/Repository/idealx/node_modules/yargs/lib/command.js:235:44)
    at Object.parseArgs [as _parseArgs] (/Users/boliang/Repository/idealx/node_modules/yargs/yargs.js:1022:30)
    at Object.get [as argv] (/Users/boliang/Repository/idealx/node_modules/yargs/yargs.js:965:21)
    at Object.initLocal (/Users/boliang/Repository/idealx/node_modules/@nrwl/cli/lib/init-local.js:18:26)
    at Object.<anonymous> (/Users/boliang/Repository/idealx/node_modules/@nrwl/cli/bin/nx.js:9:18)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 55674,
  stdout: null,
  stderr: null
}
walvekarnikhil commented 4 years ago

Getting same error /var/folders/ct/_dbchgjd6p59q90jljwyw41m0000gr/T/tmp-26391HM2WzFehx0lS/node_modules/@angular/cli/@schematics/angular/migrations/migration-collection.json The above path seems wrong, there is no @schematics folder inside @angular/cli it is directly present under node_modules.

vsavkin commented 3 years ago

Folks, there is this issue that talks about tricky migrations: https://github.com/nrwl/nx/issues/4333 (TLDR: use latest version of the migration logic and migrate one version at a time. )

Let me know if you still have issue given the points in the issue above.

vsavkin commented 3 years ago

Closing this, folks. Please reopen if you need more help.

Thanks!

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.