How to work with project files, if the Node.js is on WSL2? My IDE is WebStorm or IntelliJ IDEA.
2 Answers
What is supported right now (since 2020.2.x):
- You can run and debug apps in WSL, see https://www.jetbrains.com/help/webstorm/developing-node-js-applications.html#ws_node_wsl.
- You can open any folder located in WSL from the IDE via File > Open.
- You can use git installed in WSL2
Known problems and limitations
- File system events from WSL are not immediately reported to Windows and the IDE. So if new files are added to the project on WSL, the IDE might not see them immediately. Solved in 2020.3, see IDEA-240351.
- There’s known WSL problems with the cross-OS file system performance with WSL2 which affect us (specifically on loading the project and indexing). We hope it will be addressed by Microsoft; in the meantime, we are investigating a possibility of running the indexer inside WSL (see IDEA-255733)
As for WSL remote support similar to the one provided in VSCode, we are working on it, please see https://youtrack.jetbrains.com/issue/IDEA-197573#focus=Comments-27-4151135.0-0. Please stay tuned and sorry for the inconvenience.
According to jetbrains issue tracker working with wsl seems not to be supported currently
You would need a plugin similar to the wsl remote plugin available in vs code. In WSL VS Code currently installs a VS Code Server which is then accessed from the VS Code running on your host machine.
Unfortunately there seems to be no equivalent available by JetBrains.
However there is a tool called GWSL which would let you run graphical instances of applications installed in wsl (a feature Microsoft is also working on at the moment for future WSL releases).
Now I have no experience with GWSL but it seems to enable you to run your IDE natively on WSL and have it output to VCXSRV
If you are developing in node.js however I'd consider giving VS Code a try as it works extremely well with node.js