I am following this devdoc to get grunt working in Magento 2.1: http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/css-topics/css_debug.html

I followed all of the steps and tried to run grunt exec on the blank theme, but got an error as seen below.

Running "exec:blank" (exec) task
Running "clean:blank" (clean) task
>> 0 paths cleaned.

Done, without errors.

Execution Time (2017-05-18 08:54:02 UTC-5)
loading tasks  829ms  ██████████████████████████████████████████████ 97%
clean:blank     18ms  █ 2%
Total 853ms

>> 'php' is not recognized as an internal or external command,
>> operable program or batch file.
>> Exited with code: 1.
Warning: Task "exec:blank" failed. Use --force to continue.

Aborted due to warnings.

Do I need to run grunt from a different place? I am using docker to run my local magento environment, so php is being run on its own docker container.

Has anyone else run into this issue?

1 Answer 1


it looks like the grunt task needs php to execute? I'm not sure but I think you need to have php installed in you docker image.

Which docker image are you using to execute the grunt task?

  • Yes I think this is where the problem is. I have grunt installed on my local machine and not the docker image where php is installed. I would like to be able to run grunt without having to bash into my docker container. May 18, 2017 at 18:34
  • so I think there are 2 ways here. 1. you install php locally 2. you install grunt and php in one docker image and run the task in this image. For 1., it's also possible that you run grunt locally and point the php executable to the php docker image. But you have to mount the project root into the php docker image, so that it can access all needed files May 18, 2017 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.