PhpStorm is great, but there is only one small limitation while using it with DDEV. Since PhpStorm can't connect to the DDEV's web container of the running project, there is currently no way to just automagically use the defined nodejs_version
from .ddev/config.yaml
for ESlint, etc.
If you use the (awesome) DDEV Integration Plugin and activate ESLint, Prettier, etc. - it will even crash your DDEV project as soon as you edit a JS file. This is because the DDEV integration plugin currently sets the Remote Node.js Interpreter to this docker-compose path:
This leads to PhpStorm trying to launch another DDEV web container instead of connecting to the existing one to execute npx eslint
or similiar commands for prettier, etc. This results in an unhealthy DDEV project (which needs to be restarted via ddev restart
).
You can check these issues out for more details:
- https://github.com/php-perfect/ddev-intellij-plugin/issues/408
- https://youtrack.jetbrains.com/issue/WEB-71717
The good news: A workaround is quite simple.
Workaround: Use a remote Docker image
Just use the official node Docker image with the same version as your DDEV project in the Node.js Remote Interpreter settings for your PhpStorm project.
Select "Add" in the Node interpreter settings:
Select "Docker" and use the same NodeJS version as you have configured for your DDEV project, e.g. node:22
:
This setting applies only to the current project, so you can configure different NodeJS versions per project.
That's it, happy developing!
You can also disable the automatic path setting in the DDEV integration plugin for future projects:
Make sure to checkout DDEV Discord as well, if you have more questions. π
Top comments (0)