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

Rretzko's avatar
Level 15

Vapor installation from WIndows dev machine

Hi - I'm trying to use Vapor to run an app from AWS and I'm following the video series instructions. I've hit a snag at the deploy stage when the system tries to run the

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

command from vapor.yml. My dev environment is on a Windows machine. I've reached out to Vapor support and Nuno Maduro has been helpful and patient. On this problem, his advice is to "adjust the 'rm -rf' part of the command for Windows, or run the deploy command on Windows Subsystem for Linux" (WSL). If I understand the "rm -rf" command properly, this means to recursively delete all of the files under the root/node_modules directory, which is a significant number of files (3,441 files in 363 folders), so no small undertaking to adjust the comment. Taking the alternate route of running my dev environment under the WSL OS is an equally daunting task. I'm surprised that there's no Windows script for deployment, but maybe I'm the only one needing it. Have any of you found success running Vapor in a Windows environment and can give me some advice on moving past this point? Thanks for your assistance!

0 likes
2 replies
Rretzko's avatar
Rretzko
OP
Best Answer
Level 15

All - I found the answer in an older post from @bobbybouwmann and am including it here in case it might help someone else. Delete the

&& rm -rf node_modules

and insert a new line with

'rd /s /q "node_modules"

Here's the detailed yml:

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.