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

npm2yarn "couldn't auto-convert command" error message #8732

Closed
6 of 7 tasks
brianlagunas opened this issue Mar 4, 2023 · 3 comments
Closed
6 of 7 tasks

npm2yarn "couldn't auto-convert command" error message #8732

brianlagunas opened this issue Mar 4, 2023 · 3 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests)

Comments

@brianlagunas
Copy link

brianlagunas commented Mar 4, 2023

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

When using the npm2yarn plugin, if you specify the shorthand command npm start, the plugin will display an error # couldn't auto-convert command when the Yarn tab is selected.

image

image

If you provide the full command npm run start then there are no errors displayed in the Yarn tab.

image

image

Reproducible demo

https://stackblitz.com/edit/github-7sb7wc?file=docs%2Fintro.md

Steps to reproduce

  1. Run the stackblitz repro
  2. Click the "Docusaurus Tutorial - 5min" button to be taken to the "./docs/intro.md"
  3. Overserve the npm2yarn code blocks.

Expected behavior

I expected the Yarn tab to properly display yarn start with no errors

image

Actual behavior

An error is displayed # couldn't auto-convert command

image

Your environment

  • Public source code: see stackblitz
  • Public site URL: see stackblitz
  • Docusaurus version used: 2.3.1
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Node.js 18.13.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows

Self-service

  • I'd be willing to fix this bug myself.
@brianlagunas brianlagunas added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Mar 4, 2023
@slorber slorber added closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests) and removed status: needs triage This issue has not been triaged by maintainers labels Mar 8, 2023
@slorber
Copy link
Collaborator

slorber commented Mar 8, 2023

Indeed this issue exist in 2.3.1, but it's already fixed in main and planned to be backported for 2.4

Fixed as part of #8690

CleanShot 2023-03-08 at 18 24 07@2x

CleanShot 2023-03-08 at 18 23 40@2x

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2023
@mateotop
Copy link

mateotop commented Apr 5, 2024

If someone gets the same error today, maybe the initial command is incorrect.

For example, I use pnpm and forgot that sometimes npm and pnpm commands are different.
My mistake was that I used npm create something instead of npm init something.

So I just wrote the correct npm command, and it works for me.

@mateotop
Copy link

mateotop commented Apr 5, 2024

Here is a little visual explanation

1. Code

# Git issue explain 

:::danger [Error message]
`"couldn't auto-convert command" `
:::


## Explanation 

<details>
<summary>
    Alternative way of installation
</summary>

### ⚙️ Example of error 
Incorrect command 

\\ ```bash npm2yarn
\\ npm create docusaurus
\\ ```

### ✅ Solution 
The correct command 

\\ ```bash npm2yarn
\\ npm init docusaurus
\\ ```

</details>

2. Pictures

image

3. Gifs

git explain 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests)
Projects
None yet
Development

No branches or pull requests

3 participants