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

Azoruk's avatar

Laravel Vapor - The command "npm ci && npm run dev && rm -rf node_modules" failed

I've been working on a project for a few years and now it's finally time to deploy my application to the internet! I've been building my app on homestead, and I've been following the laravel vapor tutorial on youtube. I follow all the instructions, however when I get to the deployment part (typing "vapor deploy staging") it returns the following errors:

Screenshot 1: https://i.stack.imgur.com/S4YyS.png

Screenshot 2: https://i.stack.imgur.com/oqpSF.png

Screenshot 3: https://i.stack.imgur.com/GyXZV.png

Does anyone know what's going on here?

0 likes
1 reply
collinped's avatar

@azoruk I don't know that you want to be running "npm run dev" in that command in your vapor.yml for your production ENV:

This if you're using webpack

	- 'npm ci && npm run prod && rm -rf node_modules'

or I'd recommend this if you're using VITE:

	- 'npm ci && npm run build && rm -rf node_modules'

Please or to participate in this conversation.