Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fredemagi's avatar

Laravel Forge Deploy: No prod script found in package.json

Hello, I try to deploy an application in DigitalOcean using Laravel Forge. The deployment process fails because it can't find a deployment script, so I googled and added some:

"scripts": {
        "dev": "vite",
        "build": "vite build",
        "prod": "vite",
    }

It does not work, and I'm not really sure why?

0 likes
1 reply
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

The error message "No prod script found in package.json" indicates that Laravel Forge is looking for a script named "prod" in your package.json file, but it cannot find it.

To fix this issue, you need to add a "prod" script to your package.json file. The "prod" script should contain the command to build your application for production. For example, if you are using Laravel Mix, your "prod" script might look like this:

"scripts": {
    "dev": "npm run development",
    "build": "npm run production",
    "watch": "npm run watch-poll",
    "prod": "npm run production"
},

If you are using a different build tool or command, replace "npm run production" with the appropriate command.

Once you have added the "prod" script to your package.json file, commit the changes and try deploying your application again.

1 like

Please or to participate in this conversation.