I’m attempting to launch Vite through Node.js in Git’s command line interface by using cd 01basicvite
followed by npm run dev
, where ‘dev’ is the designated script for Vite. To elaborate, my goal is to run Vite on localhost utilizing the NodeJS script mentioned above.
Here is the script that the JSON package has
I previously performed the same procedure with React, and it executed successfully as anticipated, using identical commands.
I attempted to utilize the build
command as indicated in the image, but to no avail, and the reason behind this failure is unclear to me.
This is the HTML code here:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
and the json-package file
{
"name": "01basicvite",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"vite": "^5.2.0"
}
}
My expectation was to access the included HTML file of the pre-built Vite website, similar to my recent experience with a pre-built React website that I’m currently working on.
Sorry for not being clear or mis-heard
Any help would be appreciated