Firebase studio cannot start project because it cannot find 'next' binary

Hi - Im having problems with dependencies in my next.js firebase studio project. I decided to try and force a full rebuild of the environment by deleteing

node_modules

package-lock.json

however after I deleted these two, my system is stuck in a loop unable to find the ‘next’ command. Logs:

Starting preview...
Waiting for your web server to start serving

> next-app@0.1.0 dev
> next dev --port 9002 --port 9002 --hostname 0.0.0.0

Error: sh: line 1: next: command not found

<Firebase Studio> ✘ Preview failed to start

I have all my source code saved in github so I thought I could import my code and config into a new project but I get the same issue.
Help please I have to do a demo to a client in the morning!

i figured it out. run a terminal and reinstall next binary with:
npm install

for reasons I dont fully understand I had to remove the turbo option from packages.json:
{
“name”: “nextn”,
“version”: “0.1.0”,
“private”: true,
“scripts”: {
“dev”: “next dev”,