Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp-env: destroy command doesn't work on Windows 10 Pro #27957

Closed
slaFFik opened this issue Jan 1, 2021 · 3 comments · Fixed by #30638
Closed

wp-env: destroy command doesn't work on Windows 10 Pro #27957

slaFFik opened this issue Jan 1, 2021 · 3 comments · Fixed by #30638
Labels
[Package] Env /packages/env [Type] Bug An existing feature does not function as intended

Comments

@slaFFik
Copy link

slaFFik commented Jan 1, 2021

Describe the bug

I have Windows 10 Pro, Hyper-V enabled, Docker Desktop 3.0.0 installed and running, node v14.5.3 LTS, using cmd.exe to run a command.

wp-env destroy generates an error and, obviously, does nothing:

> wp-env destroy
i WARNING! This will remove Docker containers, volumes, and networks associated with the WordPress instance.
? Are you sure you want to continue? Yes
× Command failed: docker volume rm $(docker volume ls | grep "1e2b715f53b19e9bda31531bd2a0e2cc" | awk '/ / { print $2 }') && docker network rm $(docker network ls | grep "1e2b715f53b19e9bda31531bd2a0e2cc" | awk '/ / { print $1 }')
'grep' is not recognized as an internal or external command,
operable program or batch file.

Error: Command failed: docker volume rm $(docker volume ls | grep "1e2b715f53b19e9bda31531bd2a0e2cc" | awk '/ / { print $2 }') && docker network rm $(docker network ls | grep "1e2b715f53b19e9bda31531bd2a0e2cc" | awk '/ / { print $1 }')
'grep' is not recognized as an internal or external command,
operable program or batch file.

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) {
  killed: false,
  code: 255,
  signal: null,
  cmd: `docker volume rm $(docker volume ls | grep "1e2b715f53b19e9bda31531bd2a0e2cc" | awk '/ / { print $2 }') && docker network rm $(docker network ls | grep "1e2b715f53b19e9bda31531bd2a0e2cc" | awk '/ / { print $1 }')`,
  stdout: '',
  stderr: "'grep' is not recognized as an internal or external command,\r\n" +
    'operable program or batch file.\r\n'
}

Expected behavior

Everything should be destroyed.

@Soean Soean added the [Package] Env /packages/env label Jan 2, 2021
@noahtallen
Copy link
Member

he problem is that we execute some commands on the CLI which are available in bash which are unfortunately not on windows (like grep). This is definitely an oversight on my part.

@carolinan
Copy link
Contributor

Any update on this?

@noahtallen
Copy link
Member

Sorry for taking so long on this. It should be working on trunk now, and I hope we can release an npm update within a week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Env /packages/env [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants