If @nrwl/nx-cloud is installed in an Nx workspace and the user attempts to update Nx with nx migrate latest then the command will fail due to the @nrwl/nx-cloud version not being in sync with the rest of the Nx plugins.
nx migrate latest will update all Nx plugins without error.
npx [email protected] nx-cloud-bug
yarn add -D -E @nrwl/nx-cloud
nx migrate latest
yarn run v1.22.5
$ nx migrate latest
Fetching meta data about packages.
It may take a few minutes.
Fetching @nrwl/workspace@latest
Fetching typescript@~4.0.3
Fetching @typescript-eslint/[email protected]
Fetching @typescript-eslint/[email protected]
Fetching @angular-devkit/architect@~0.1001.3
Fetching @angular-devkit/build-webpack@~0.1001.3
Fetching @angular-devkit/build-optimizer@~0.1001.3
Fetching @angular-devkit/core@~10.1.3
Fetching @angular-devkit/schematics@~10.1.3
Fetching @nrwl/[email protected]
Fetching @nrwl/[email protected]
Fetching @nrwl/[email protected]
Fetching @nrwl/[email protected]
Fetching @nrwl/[email protected]
Fetching @nrwl/[email protected]
Fetching @nrwl/[email protected]
Fetching @nrwl/[email protected]
Fetching @nrwl/[email protected]
Fetching @nrwl/[email protected]
Fetching [email protected]
Fetching [email protected]
ERROR The migrate command failed. Try the following to migrate your workspace:
> npm install --save-dev @nrwl/workspace@latest
> nx migrate @nrwl/workspace@latest --from="@nrwl/[email protected]"
This will use the newest version of the migrate functionality, which might have your issue resolved.
----------------------------------------------------------------------------------------------------
Command failed: npm install @nrwl/[email protected] --prefix=/var/folders/w3/75kygqx57ds19cjxt50x5cyw0000gn/T/tmp-89345zKuoZXEHG580
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @nrwl/[email protected].
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/devinshoemaker/.npm/_logs/2020-10-04T15_50_12_587Z-debug.log
Run migrate with --to="package1@version1,package2@version2"
/Users/devinshoemaker/code/nx/nxtend/node_modules/yargs/build/lib/yargs.js:1132
throw err;
^
Error: Command failed: ./node_modules/.bin/tao migrate latest
at checkExecSyncError (child_process.js:630:11)
at Object.execSync (child_process.js:666:15)
at Object.handler (/Users/devinshoemaker/code/nx/nxtend/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:77:21)
at Object.runCommand (/Users/devinshoemaker/code/nx/nxtend/node_modules/yargs/build/lib/command.js:196:48)
at Object.parseArgs [as _parseArgs] (/Users/devinshoemaker/code/nx/nxtend/node_modules/yargs/build/lib/yargs.js:1043:55)
at Object.get [as argv] (/Users/devinshoemaker/code/nx/nxtend/node_modules/yargs/build/lib/yargs.js:986:25)
at Object.initLocal (/Users/devinshoemaker/code/nx/nxtend/node_modules/@nrwl/cli/lib/init-local.js:24:13)
at Object.<anonymous> (/Users/devinshoemaker/code/nx/nxtend/node_modules/@nrwl/cli/bin/nx.js:12:18)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 89345,
stdout: null,
stderr: null
}
error Command failed with exit code 1.
> NX Report complete - copy this into the issue template
nx : Not Found
@nrwl/angular : Not Found
@nrwl/cli : 10.2.0
@nrwl/cypress : 10.2.0
@nrwl/eslint-plugin-nx : 10.2.0
@nrwl/express : Not Found
@nrwl/jest : 10.2.0
@nrwl/linter : 10.2.0
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : 10.2.0
@nrwl/react : 10.2.0
@nrwl/schematics : Not Found
@nrwl/tao : 10.2.0
@nrwl/web : 10.2.0
@nrwl/workspace : 10.2.0
typescript : 3.9.7
We noticed this and it is fixed in 10.3.0.
There's little that we can do for users on 10.2.x because the logic is already a part of nx migrate in that version.
Because of the difficulty of fixing errors in the nx migrate process, in the error, you can find the recommended solution.
ERROR The migrate command failed. Try the following to migrate your workspace:
> npm install --save-dev @nrwl/workspace@latest
> nx migrate @nrwl/workspace@latest --from="@nrwl/[email protected]"
This will use the newest version of the migrate functionality, which might have your issue resolved.
After you install @nrwl/[email protected] or later, this issue will be fixed.. and executing nx migrate @nrwl/workspace@latest --from="@nrwl/workspace@[version] will succeed.
I will keep this issue open so that people can find it if they come to the repo to open an issue.
Added some notes about it here: https://github.com/nrwl/nx/issues/4333
The migration script worked incorrectly. npx @nrwl/tao@latest migrate latest should do the trick.
I'm going to close this issue.
Most helpful comment
We noticed this and it is fixed in
10.3.0.There's little that we can do for users on
10.2.xbecause the logic is already a part ofnx migratein that version.Because of the difficulty of fixing errors in the
nx migrateprocess, in the error, you can find the recommended solution.After you install
@nrwl/[email protected]or later, this issue will be fixed.. and executingnx migrate @nrwl/workspace@latest --from="@nrwl/workspace@[version]will succeed.I will keep this issue open so that people can find it if they come to the repo to open an issue.