ionic-team / vscode-ionic

Visual Studio Code Ionic Extension
Other
11 stars 1 forks source link

The extension doesn’t use Yarn as the package manager in a Yarn workspace monorepo. #210

Closed jb-thery closed 1 month ago

jb-thery commented 1 month ago

Hi,

I’m encountering an issue where the Ionic extension in VS Code partially works with Yarn 4 in a Yarn workspace monorepo setup. As shown in the screenshots below, I get errors when the extension attempts to run the command npm --list. I believe it should be running this command using Yarn instead of npm.

I’ve ensured that Yarn 4 is correctly set as the package manager in my package.json, and I’ve also configured it in my VS Code settings. However, I’m unsure where the problem is coming from, and I would appreciate any guidance on this.

I’m happy to provide any additional information that might be helpful, but I’m not certain what else would be relevant at this point to troubleshoot the issue.

Let me know if you need any more details, and I’ll be glad to share them.

Thank you!

Capture d’écran 2024-10-22 à 02 55 50 Capture d’écran 2024-10-22 à 02 55 33
dtarnawsky commented 1 month ago

The message about npm list not returning anything is because the VS Code extension relies on knowing what the latest version of a package is. Yarn 4 doesn't have this feature which is why the "install yarn outdated plugin" recommendation is given. Can you click this to install the plugin?

jb-thery commented 1 month ago

When I click on “Install Yarn Outdated Plugin”, I encounter this issue :

Capture d’écran 2024-10-22 à 19 13 44

I also tried the following command, but it doesn’t work either: yarn plugin import https://go.mskelton.dev/yarn-outdated/v4

Capture d’écran 2024-10-22 à 19 15 42 Capture d’écran 2024-10-22 à 19 20 14
dtarnawsky commented 1 month ago

It looks like that plugin author moved where the plugin could be installed.

I was able to run yarn plugin import https://go.mskelton.dev/yarn-outdated/v4 at the terminal without an issue allowing the command yarn outdated to work.

What error do you get when calling yarn plugin import https://go.mskelton.dev/yarn-outdated/v4 ?

jb-thery commented 1 month ago

I ran yarn outdated and it works fine, but whenever I open VS Code, I keep seeing the same errors as shown in the screenshot. I believe this is happening because the Ionic VS Code extension is running npm outdated --json instead of yarn outdated --json.

I manually tried npm outdated --json, and it works without any issues. However, I haven’t been able to find an equivalent command with yarn for npm list.

dtarnawsky commented 1 month ago

Would you happen to be able to share your project? You can DM damian@ionic.io . A working reproduction of the problem is what I'd need in order to fix it.

dtarnawsky commented 1 month ago

v1.97.0 has been released. Give it a try - it should resolve the issue.

jb-thery commented 1 month ago

@dtarnawsky Thanks for your help! I’ve updated the Ionic extension to v1.97.0, but the extension always uses npm instead of yarn on my end.

dtarnawsky commented 1 month ago

There was a merge issue and ended up having to re-release as v1.97.1. Should be available in a few minutes.

jb-thery commented 1 month ago

Amazing, it's work now, thanks for all @dtarnawsky