skip to Main Content

I’m trying to run a React Vite project I cloned from GitHub but I did not have a Vite project prior to cloning. This is the error:

npm error Missing script: "start"
npm error
npm error Did you mean one of these?
npm error   npm star # Mark your favorite packages
npm error   npm stars # View packages marked as favorites
npm error
npm error To see a list of scripts, run:
npm error   npm run

I expected it to run in my browser.

2

Answers


  1. Since you cloned React Vite project from Github, your project doesn’t use a start script but has a different entry point dev, so use:

    npm run dev
    

    For it to start and open on the browser.

    Note: this will only work after you have run npm install or npm i after cloning.

    Login or Signup to reply.
  2. you can check all scripts in the package.json file.

    scripts": {
    "dev": "vite",
    "build": "vite build",
    "lint": "eslint .",
    "preview": "vite preview"
    

    },

    These are by default available in Vite React project so, if you want to run the app the command is npm run dev and make sure you’re in root dir of your project.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search