nrwl / nx-console

Nx Console is the user interface for Nx & Lerna.
https://nx.dev
MIT License
1.31k stars 212 forks source link

yarn3 pnp - Cannot find a local installation of Nx. #2017

Closed elizww closed 7 months ago

elizww commented 9 months ago

Current Behavior

Error running '....' Cannot find a local installation of Nx.

Expected Behavior

any target should run from nx-console

Steps to Reproduce

Failure Logs / Images / Videos

2024-02-06 14:41:44,455 [1631841] INFO - #c.i.e.r.ExecutionUtil - Error running 'client-ligo-admin-feature-positions:storybook':
Cannot find a local installation of Nx. com.intellij.execution.ExecutionException: Cannot find a local installation of Nx. at dev.nx.console.utils.NxExecutable$Companion.getExecutablePath(NxExecutable.kt:40) at dev.nx.console.run.NxCommandLineState.startProcess(NxCommandLineState.kt:82) at com.intellij.javascript.nodejs.execution.NodeBaseRunProfileState$Companion.runInBackground(NodeBaseRunProfileState.kt:57) at com.intellij.javascript.nodejs.execution.NodeBaseRunProfileState$Companion.access$runInBackground(NodeBaseRunProfileState.kt:40) at com.intellij.javascript.nodejs.execution.NodeBaseRunProfileState$Companion$executeUnderProgress$1.run(NodeBaseRunProfileState.kt:48) at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:434) at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:132) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:484) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:248) at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:73) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:192) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:610) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:685) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:641) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:609) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:78) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:179) at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:73) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:248) at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:498) at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81) at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81) at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:86) at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:81) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:464) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:840)

Environment

Cammisuli commented 9 months ago

Has this worked for you before? I'm going to have to set up a repo and try it myself.

We're using the jetbrains APIs to get the node interpreter and package manager, so hopefully nothing has changed there.

Thanks for the report!

@MaxKless if you dont mind taking a look when you come back.

elizww commented 9 months ago

I think it stopped working when we move to yarn3 and pnp, but honestly I don't know if it was before or after moving to pnp, it worked with yarn 1

MaxKless commented 8 months ago

Hey sorry I lost track of this! Does this happen for all nx repos you use or just the one? Is there any way you could set up a minimal repro and share it with me so I can track this down? Also, it would be great if you could run nx report and paste the results here so I know what platform to look for.

ChoSeoHwan commented 8 months ago

I'm encountering the same error in WebStorm 2023.3 across two different environments.

nx report

 >  NX   Report complete - copy this into the issue template

   Node   : 20.9.0
   OS     : darwin-x64
   yarn   : 4.1.1

   nx                 : 17.3.1
   @nx/js             : 17.3.1
   @nx/jest           : 17.3.1
   @nx/eslint         : 17.3.1
   @nx/workspace      : 17.3.1
   @nx/devkit         : 17.3.1
   @nx/esbuild        : 17.3.1
   @nx/eslint-plugin  : 17.3.1
   @nx/nest           : 17.3.1
   @nx/node           : 17.3.1
   @nx/plugin         : 17.3.1
   @nx/webpack        : 17.3.1
   typescript         : 5.3.3
   ---------------------------------------
   Community plugins:
   @jscutlery/semver : 4.2.0
   ---------------------------------------
   Local workspace plugins:
         @notification-service/nx

When looking at the code of nx console, it appears to simply use the API to import the package provided within webstorm.

So, I tried to raise the issue directly on webstorm's youtrack, but Since I am not a developer of nx console, I may leave an issue with incorrect information, so I did not leave a separate comment.

If this issue is an issue with webstorm itself, could you please add the issue to webstorm's youtrack?