How can I install a dife…

2 minute read

How can I install a diferent nx version? i am on nx 9.4, but I want to downgrade to 8.12.9. Tried these, but nx keeps showing 9.4 npm uninstall -g @nrwl/cli npm install -g @nrwl/cli@^8.12.9

Responses:

you might have @nrwl deps installed locally too?

How would you do it?

going from 9 to 8 might be slightly difficult because youll be downgrading the version of angular as well.

Which means some migrations will need to be reverted (specifically things like ViewChild and other api changes to angular)

i had to do it and it was a pain in the ass, but if you just run npm install --save @nrwl/workspace@8.12.9 and npm install anything else that you need to downgrade (including angular) then just run ng serve on your app and fix whatever comes up

I saw the local deps. it might be my last resource. I uninstalled/installed the followings: node, npm, my macos, nrwl but it did not work. I even switched to my windows laptop with nice specs and node keeps creating multiple processes.

do you have a workspace? Or did you generate a new one and try to downgrade? if you don’t have existing code then I think you can do npx create-nx-workspace@8.12.9

Yup is right if you want to give it a shot. you can create one with any version

If you do have existing code, you could try my suggestion and then port things over. The scary part of downgrading is that migrations probably have been performed during upgrades that can’t be easily reversed.

I have an existing workspace. I can try that too. Thanks.

Let us know how things go.

Might as well give it a shot

But ya what Devin said, I had to do it one time and it was a pain

I was not able to create a workspace with a different version. Kept telling about an issue with the @nrwl/workspace lib. I basically ended up running the dist/myapp built files using node node dist/myapp/main.js --port 7000 It runs and is super light. It is the best I could do right now. I also installed Pop!_OS on my dell machine and I get the same disastrous result when run nx serve api Though popos has a swap feature and seems handling a lot better. At least I have a few options. Here is a screenshot of my PopOS memory running my backend on nx

and Update: I was able to set the –maxWorkers when building the app. nx build myapp --maxWorkers=1 That why i was able to prevent nx build process from creating 14 processes.

Interesting, so you needed the maxWorkers property when running locally? I’ve seen this needed in CircleCI, but not locally so far.

Updated: