Closed andynunes closed 2 years ago
After several failed attempts to migrate project into a nx
project at my startup, I've taken a stab at starting fresh with nx
at a different organization. However, I've encountered two showstopper bugs just in the process of setting up the scaffolding in the first week.
This influx of new show-stopping issues is making me lose confidence and seriously reconsider nx
altogether.
I believe this is an issue with Nx 13.9.0 and the switch away from tao
. I have dug into the code because I had a migration 2 days ago that works just fine, but now my migrations are doing the same as above. From what I can gather, the code that calls the migrate command is based in version 13.8.5 (or really any version in 13 before 13.8.5. I have tried 13.1.4 and 13.7.3 as well). When this code runs, it installs the most recent version of tao and the nx cli into a temp folder.
https://github.com/nrwl/nx/blob/fd645460214bfb45726f983c1ce570a4bfb4e2fe/packages/workspace/src/command-line/nx-commands.ts#L288-L295
Once it does this, it returns this as the version that should be used to make the migration call. The issue seems to stem from pulling in the local project version of nx again here:
https://github.com/nrwl/nx/blob/1b7a3b2b74c4395da55bffabd4923e973f6c58de/packages/nx/bin/nx.ts#L37-L70
Based on the comments, it looks like it is supposed to be going down line 47 to use the local nx in the temp directory, but instead it fails the if statement on line 46 and ends up thinking it is running the globally installed cli and hands the process back off to the local version which is the original file as the parent process kicking off an infinite loop.
I can say that by changing line 597 below to 13.8.8 fixes this issue.
same here, try to migrate to version 13.9.0 really causes my laptop to explode. (joke aside)
And this is a show stopper for me as i cannot get the latest fix about the storybook staticDir fix which is available on that version. nx migrate latest
hangs forever for me. :(
Thanks @jahumes for the detailed validation and @leosvelperez for the fast fix and release!
I just ran the migration to 13.9.1
. After running npm install
, I'm getting the following error:
☁ services [1-nx-scaffolding] ⚡ nx run user-service:build
Unexpected error:
Error: Cannot find module 'nx/src/cli/run-cli.js'
@andynunes can you verify that "nx" is listed as a dependency in package.json? Verify it and all other nrwl packages (aside from cloud) are at 13.9.1.
@andynunes I had the same issue after running nx migrate
(with npm install
and running migrations) then as prompted running npm install -g nx
.
In my case running npm install
again fixed the problem.
@AgentEnder That fixed it for me but why can't the migration handle adding nx
to devDeps
? It's a bit weird that it is now mandatory because it was not before.
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.
Current Behavior
When running nx migrate to latest version, a new node process is created approximately every second and the processes hang and continue to build up with no apparent ability to stop them from spawning.
Expected Behavior
Nx migrate completes by using a single node process and doesn't fork bomb my computer.
Steps to Reproduce
13.8.5
using WebStormnx migrate
to13.9.0
Nx Migrate Workspace
Failure Logs
Excerpt from
ps
Environment