Hello,
I'm currently trying to deploy my Laravel project to a live server (Forge/Envoyer setup). In the deployment hook I'm npm installing using:
npm install --production
so the devDependencies are ignored. However the next step fails:
npm run prod
with the error:
sh: 1: mix: not found
Moving laravel-mix out of devDependencies and into dependencies fixes this but then the next error I get is:
We couldn't find a supported version of Vue in your project. Please ensure that it's installed (npm install vue).
This is another package sitting in devDependencies.
All of these packages were placed in devDependencies when I first created the Laravel project, and I confused why I have to move them all into dependencies to get them to work?
I could just run npm install without the --production tag but I didn't really want to install Cypress on my server.
Here's my package.json:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"@inertiajs/inertia": "^0.3.6",
"@inertiajs/inertia-vue": "^0.2.4",
"@inertiajs/progress": "^0.1.2",
"@tailwindcss/ui": "^0.1.3",
"axios": "^0.21.1",
"cypress": "^6.8.0",
"laravel-jetstream": "^0.0.3",
"laravel-mix": "^6.0.39",
"lodash": "^4.17.19",
"portal-vue": "^2.1.7",
"postcss": "^8.4.4",
"postcss-import": "^12.0.1",
"resolve-url-loader": "^3.1.0",
"tailwindcss": "^1.3.0",
"vue": "^2.5.17",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.12"
},
"dependencies": {
"chart.js": "^3.5.1",
"v-calendar": "^2.1.6"
}
}
Thanks in advance :)