i’m making laravel-react app and tried to host it. i did the composer install, npm install. Then, i tried to npm run build but i got sh: vite: command not found
i notice there is no vite in /node_modules/.bin/
even though, there is vite in my package.json
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"@headlessui/react": "^1.4.2",
"@inertiajs/react": "^1.0.0",
"@tailwindcss/forms": "^0.5.3",
"@vitejs/plugin-react": "^3.0.0",
"autoprefixer": "^10.4.12",
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.8",
"lodash": "^4.17.19",
"postcss": "^8.4.18",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.2.1",
"vite": "^4.5.3"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@inertiajs/inertia": "^0.11.1",
"@mui/icons-material": "^5.16.0",
"@mui/material": "^5.16.0",
"material-icons": "^1.13.12",
"react-material-ui-carousel": "^3.4.2",
"react-responsive-carousel": "^3.2.23",
"react-router-dom": "^6.25.1",
"react-slick": "^0.30.2",
"slick-carousel": "^1.8.1"
}
}
and this is my vite.config.js:
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
laravel({
input: ["resources/css/app.css", "resources/js/app.jsx"],
refresh: true,
}),
react(),
],
resolve: {
alias: {
"@": "/resources",
},
},
});
i also tried to npm install vite –save-dev but still no empty response when:
npm list vite
in local environment its working fine also
New contributor
user27343663 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.