'"command not found: wp-env" even though the package was installed

I'm learning how to develop a website with Wordpress and I'm using Docker for the first time. I followed this tutorial: https://developer.wordpress.org/block-editor/getting-started/devenv/

Basically I installed Docker, then the @wordpress/env package, ran the wp-env start command in a wordpress directory. It created a Docker image and started the container.

Everything worked fine, but somehow I thought I still needed to install php so I did that through homebrew. Then I closed my Macbook and had dinner. Now I came back, created a Wordpress plugin with @wordpress/create-block and tried to use wp-env start in its directory, but the command couldn't be found anymore?

I tried uninstalling and installing the @wordpress/env package again but I still get the error zsh: command not found: wp-env.

I can still start the docker container from the initial attempt, but when I try wp-env commands it just can't be found. I don't know much about terminal commands either.

Can anyone give me tips where to look for the error?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source