"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
this is my script
"scripts": {
"start": " react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
I tried using these scripts instead but it would show this error
> [email protected] start
> react-scripts start
Could not find a required file.
Name: index.html
Harrison
2,49512 gold badges24 silver badges48 bronze badges
1 Answer 1
Make sure you have Vite installed as a dependency in your project. You can install Vite using:
npm install vite --save-dev
Update your start script in the scripts section of your package.json to use Vite:
"scripts": {
"start": "vite",
"build": "vite build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
Ensure that your Vite project has the required files, including an index.html file in the root of your project. If it's missing, you can create a basic index.html file after run the app with npm start
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
lang-js