0

我尝试使用 nx migrate 命令从 angular 11 迁移到 angular 12,但是我有一个错误,我无法理解发生了什么以及如何修复它。

基本上,当我运行nx migrate latest我的输出是:

/Users/USERNAME/Projects/myNxAngular11Project/node_modules/yargs/build/lib/yargs.js:1132
                throw err;
                ^

Error: Command failed: npm install --legacy-peer-deps
    at checkExecSyncError (child_process.js:635:11)
    at Object.execSync (child_process.js:671:15)
    at taoPath (/Users/USERNAME/Projects/myNxAngular11Project/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:312:21)
    at Object.handler (/Users/USERNAME/Projects/myNxAngular11Project/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:86:19)
    at Object.runCommand (/Users/USERNAME/Projects/myNxAngular11Project/node_modules/yargs/build/lib/command.js:196:48)
    at Object.parseArgs [as _parseArgs] (/Users/USERNAME/Projects/myNxAngular11Project/node_modules/yargs/build/lib/yargs.js:1043:55)
    at Object.get [as argv] (/Users/USERNAME/Projects/myNxAngular11Project/node_modules/yargs/build/lib/yargs.js:986:25)
    at Object.initLocal (/Users/USERNAME/Projects/myNxAngular11Project/node_modules/@nrwl/cli/lib/init-local.js:24:13)
    at Object.<anonymous> (/Users/USERNAME/Projects/myNxAngular11Project/node_modules/@nrwl/cli/bin/nx.js:43:18)
    at Module._compile (/Users/USERNAME/.nvm/versions/node/v12.21.0/lib/node_modules/@nrwl/cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 75743,
  stdout: null,
  stderr: null
}

我不知道为什么以及如何解决这个问题。我尝试了 npm 6.14.13 和 7.16.0,仅使用节点 12.21.0。(在每个版本更改时使用 rm -fr ./node_modules)

在这里你可以找到我的 nx 报告


>  NX  Report complete - copy this into the issue template

  Node : 12.21.0
  OS   : darwin x64
  npm  : 7.16.0
  
  nx : Not Found
  @nrwl/angular : 12.0.8
  @nrwl/cli : 12.0.8
  @nrwl/cypress : 12.0.8
  @nrwl/devkit : 12.0.8
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : Not Found
  @nrwl/jest : 12.0.8
  @nrwl/linter : 12.0.8
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.0.8
  @nrwl/web : Not Found
  @nrwl/workspace : 12.0.8
  @nrwl/storybook : Not Found
  @nrwl/gatsby : Not Found
  typescript : 4.1.4

我不知道该怎么办,你知道为什么会崩溃吗?我应该使用哪个版本的 npm/node ?也许我的 nx 安装已损坏(当我将 npm 从 v6 切换到 v7 时,我运行 npm i -g nx --force 以重新安装正确的包,但不确定这是否会改变某些东西)

4

2 回答 2

0

在今天发布的 cli 版本 12.4.0 中已修复https://github.com/nrwl/nx/releases/tag/12.4.0

于 2021-06-16T15:55:14.373 回答
0

已在 github 中修复。是一个非常烦人的错误。

于 2021-06-21T08:27:09.440 回答