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

Daniel-Pablo's avatar

vapor error deployin with windows 10, any help?

DEPLOYING TO VAPOR WITH WINDOWS GOT THIS ERROR


  The command "npm ci && npm run dev && rm -rf node_modules" failed.                                                                                      
                                                                                                                                                          
  Exit Code: 1(General error)                                                                                                                             
                                                                                                                                                          
  Working directory: C:\Users\danie\Apps\LMAcademy/.vapor/build/app                                                                                       
                                                                                                                                                          
  Output:    


  'rm' is not recognized as an internal or external command,                                                                                              
  operable program or batch file.

Any clue how to solve it?

0 likes
3 replies
bobbybouwmann's avatar
Level 88

Well, rm -rf is a unix command. You need to use the Windows command or you bash on Windows. Bash on windows is by far the easiest solution because you can then use all unix commands as well. This tutorial should help you out for that: https://itsfoss.com/install-bash-on-windows/

If you really want to use the windows command line you need to replace it with this line

rd /s /q "node_modules"

source: https://stackoverflow.com/questions/97875/rm-rf-equivalent-for-windows

4 likes
Rretzko's avatar

@bobbybouwmann THANKS! I was hitting the same problem and this allowed me to successfully complete the deploy step. I've included the set-up in case it will help someone else.

id: 40827
name: tdrlib
environments:
    production:
        memory: 1024
        cli-memory: 512
        runtime: 'php-8.1:al2'
        build:
            - 'set COMPOSER_MIRROR_PATH_REPOS=1 && composer install --no-dev'
            - 'php artisan event:cache'
            - 'npm ci && npm run build'
            - 'rd /s /q "node_modules"'
1 like

Please or to participate in this conversation.