Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nx console generate for VS Code isn't working with yarn 2 #1159

Closed
danielchikaka opened this issue Oct 15, 2021 · 3 comments · Fixed by #1213
Closed

Nx console generate for VS Code isn't working with yarn 2 #1159

danielchikaka opened this issue Oct 15, 2021 · 3 comments · Fixed by #1213
Labels
type: bug Something isn't working

Comments

@danielchikaka
Copy link

I can't run Nx console's generate on my visual studio code. I have tried to downgrade the plugin package and got the same results with this error "Could not execute task since node_modules directory is missing..." but the node_modules folder is there.

@Cammisuli
Copy link
Member

Cammisuli commented Oct 15, 2021

If you go into the Nx Console extension view and look into the Generate & Run Target, do you see your current workspace listed there (beside the change workspace item, like below), and does it match your actual vscode workspace?
image

@awidjaja
Copy link

I have the same error message for my workspace. I use yarn version 2 (berry) for my package manager. Yarn is configured to use plug and play and zero install mode and thus is not using node_modules but .yarn/cache to store the insalled packages. yarn nx -version is showing the right nx version from my workspace, and the nx cli works from terminal but the nx console extension is looking for node_modules folder. The current workspace listed in Nx console change wrkspace item.

To replicate this issue, you can install a new nx workspace using yarn create nx-workspace --preset=npm command and then do yarn set version berry, add nodeLinker: pnp in .yarnrc.yml and do yarn install. It will install yarn 2 locally and migrate all packages and scripts in node_modules into .yarn/cache folder.

Considering this is the future of yarn and the NX cli already works, NX console should be updated to support this.

@Cammisuli
Copy link
Member

No arguments here. If Nx Console doesn't work with berry, and all that jazz, it's definitely something to be fixed.

@Cammisuli Cammisuli added the type: bug Something isn't working label Oct 23, 2021
@Cammisuli Cammisuli changed the title Nx console generate for VS Code isn't working Nx console generate for VS Code isn't working with yarn 2 Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants