My project using next.js ecommerce starter is not running locally

6 replies
Last updated: Jan 28, 2026
i have created a project using next.js ecommerce starter.I am not able to run it locally.
steps i followed.

vercel env pull
to rename .env filechanged delevelopment command in
vercel.com to
npm run dev

used
npm start
to start developement server which gives error

~/projects/e-commerce$ npm start

> sanity-template-nextjs-ecommerce@1.0.0 start /home/hussamkhatib/projects/e-commerce
> vercel dev

sh: 1: vercel: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! sanity-template-nextjs-ecommerce@1.0.0 start: `vercel dev`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the sanity-template-nextjs-ecommerce@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/hussamkhatib/.npm/_logs/2021-01-28T04_47_29_680Z-debug.log

AI Update

The error message is telling you exactly what's wrong - you have two issues to fix:

  1. Missing node_modules: You haven't installed the dependencies yet
  2. Vercel CLI not found: The vercel command isn't available

Here's how to fix this:

Step 1: Install dependencies

npm install

This 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 vercel

Step 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 dev

This 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 start

Quick 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.

Show original thread
6 replies

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.

Was this answer helpful?