nrwl/add-nx

[add-nx-to-monorepo] As of Nx 13, project configuration should be moved from nx.json to workspace.json/project.json

ryanrw opened this issue · 0 comments

What happens?

I run npx add-nx-to-monorepo command on exist yarn workspace project with nx cloud initialization option. And this error happened as below

yarn run v1.22.11
$ /Users/ryanwillpower/codes/monorepo/node_modules/.bin/nx g @nrwl/nx-cloud:init

 ERROR  As of Nx 13, project configuration should be moved from nx.json to workspace.json/project.json. Please run "nx format" to fix this.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command failed: yarn nx g @nrwl/nx-cloud:init
    at checkExecSyncError (child_process.js:635:11)
    at Object.execSync (child_process.js:671:15)
    at initCloud (/Users/ryanwillpower/.npm/_npx/69752/lib/node_modules/add-nx-to-monorepo/src/add-nx-to-monorepo.js:286:21)
    at /Users/ryanwillpower/.npm/_npx/69752/lib/node_modules/add-nx-to-monorepo/src/add-nx-to-monorepo.js:40:13
    at Generator.next (<anonymous>)
    at fulfilled (/Users/ryanwillpower/.npm/_npx/69752/lib/node_modules/add-nx-to-monorepo/node_modules/tslib/tslib.js:114:62)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 69806,
  stdout: null,
  stderr: null
}

If I don't select nx cloud initialization option, when I run yarn nx run-many --target=build --all --parallel command, which the terminal suggests to me, the error still happened

❯ yarn nx run-many --target=build --all --parallel
yarn run v1.22.11
$ /Users/ryanwillpower/codes/monorepo/node_modules/.bin/nx run-many --target=build --all --parallel

 ERROR  As of Nx 13, project configuration should be moved from nx.json to workspace.json/project.json. Please run "nx format" to fix this.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What I expected

I expected to run the command npx add-nx-to-monorepo and after that, I want to run any command without running nx format to fix this issue.