My project using next.js ecommerce starter is not running locally
The error message is telling you exactly what's wrong - you have two issues to fix:
- Missing
node_modules: You haven't installed the dependencies yet - Vercel CLI not found: The
vercelcommand isn't available
Here's how to fix this:
Step 1: Install dependencies
npm installThis will install all the packages listed in your package.json, including the project dependencies and the Vercel CLI (if it's in the dependencies).
Step 2: Install Vercel CLI globally (if needed)
If vercel still isn't found after npm install, you may need to install the Vercel CLI globally:
npm install -g vercelStep 3: Run the development server
After installing dependencies, use the correct command. Looking at your error, the start script runs vercel dev, but for local Next.js development you typically want:
npm run devThis should run the standard Next.js development server. If the project is configured to use vercel dev specifically, then after installing dependencies, you can use:
npm startQuick Summary:
The issue wasn't with your environment variables or Vercel configuration - you simply skipped the npm install step that installs all the project dependencies. The warning message even tells you this: "Local package.json exists, but node_modules missing, did you mean to install?". Always run npm install (or yarn install) right after cloning or creating a new project before trying to run it.
If you continue to have issues after installing dependencies, check the package.json file to see what scripts are actually available and what they do. The dev script is typically what you want for local development with Next.js and Sanity.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.