Local setup of nextjs repo
Unanswered
</> Sarah A posted this in #help-forum
Hey guys I have a question. I'm trying to contribute to nextjs for the first time, and I looked through the discussions, got a feel for the community yk, and then forked and cloned the repo to ,y local machine but when I do so the fans go in jetpack mode and it heats up my laptop, like later on it dies down but still fails to connect to wsl. I do badi ally everything in wsl. I'm using a decent machine, it's an msi thin 15 with intel i7. Wondering if anyone faced similar issues before? What's the correct way to set it up locally so that it doesn't burden my cpu and I can actually get on with looking through the repo and modifying the code to make my first pr?
2 Replies
it stressing your system is common. I don't think you can do anything about it but just deal with it
Yeah, that’s pretty normal with a repo this big, especially on WSL. A few things that usually help:
Make sure the repo is inside the WSL filesystem, like "~/src/next.js", not under "/mnt/c/...". Windows-mounted paths are way slower and can make CPU usage spike.
I’d also clone it blobless:
Then use "pnpm install", but avoid running the full dev/watch commands until you actually need them. The initial install/build can be heavy, so for a first PR I’d try to make a small change and run only the relevant tests instead of the whole suite.
Also, if WSL locks up, "wsl --shutdown" from PowerShell usually clears it. You can also cap WSL CPU/RAM with a ".wslconfig" file if it keeps taking over the machine.
Make sure the repo is inside the WSL filesystem, like "~/src/next.js", not under "/mnt/c/...". Windows-mounted paths are way slower and can make CPU usage spike.
I’d also clone it blobless:
git clone https://github.com/vercel/next.js.git --filter=blob:none --single-branchThen use "pnpm install", but avoid running the full dev/watch commands until you actually need them. The initial install/build can be heavy, so for a first PR I’d try to make a small change and run only the relevant tests instead of the whole suite.
Also, if WSL locks up, "wsl --shutdown" from PowerShell usually clears it. You can also cap WSL CPU/RAM with a ".wslconfig" file if it keeps taking over the machine.