nx-console icon indicating copy to clipboard operation
nx-console copied to clipboard

Nx Console broken on JetBrains + WSL

Open MaxKless opened this issue 1 year ago • 6 comments

I've muddled up some issues so I will move this discussion here @ericjeker. I will hide the discussion in other issues to keep things clean.

image image image

MaxKless avatar Sep 15 '23 15:09 MaxKless

Sorry again for the confusion with the differen WSL issues. Let's continue here.

@ericjeker it looks like an issue with the wsl node interpreter - have you gone through the WSL guide, especially this last section? https://www.jetbrains.com/help/webstorm/how-to-use-wsl-development-environment-in-product.html#ws_wsl_node_interpreter_configure

Maybe the wrong node interpreter is configured?

MaxKless avatar Sep 15 '23 15:09 MaxKless

Hi Max, yes I actually tried with both the Window interpreter and WSL interpreter but none were working.

I tried with nx-example as suggested in the other thread but same result with the 0.0.1 version you provided in the other thread. But then I updated back to 1.13.1 and restarted my IDE and now I can display the Nx Console and run the Deps Graph but not the commands.

I am wondering if it's because I use Volta?

I tried also to run the View Full Graph and I got this error in the 0.0.1: image

When I try to run a command I got this error: image

And in the log, I found out there are some weird paths. That node_modules directory doesn't exist at all. Not sure how this path is generated?

2023-09-15T17:28:18.832Z - Generating graph with command: `npx nx dep-graph --file ./..\..\..\..\Windows\node_modules\.cache\nx\nx-console-project-graph\project-graph.html`

I feel like there is a lot of confusion between the Windows path and WSL path. Also the usage of slash and backslash seems a bit random.

ericjeker avatar Sep 15 '23 17:09 ericjeker

image

it looks like nx console coudn't recognize wsl path when running serve, generators and project graph do work though

dev-seahouse avatar Oct 05 '23 11:10 dev-seahouse

To sum up at the discussion: The plugin seems to ignore the Node Interpreter configured at the IDE's config "Language and Frameworks > Node.js > Node Interpreter", because it only works from the UI if you have nodejs on the windows itself.

leonardoldr23 avatar Dec 18 '23 13:12 leonardoldr23

I'm on 2024.1.3 and after updating my node interpreter to the WSL one, restarting the IDE fixed the Nx Console plugin.

BaronVonPerko avatar Jun 17 '24 20:06 BaronVonPerko

can you try again as well @leonardoldr23 @dev-seahouse @ericjeker? The Node Interpreter should be taken into account by Nx Console

MaxKless avatar Jun 18 '24 08:06 MaxKless