question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[npm2yarn]: `npm init` => `yarn create`

See original GitHub issue

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

See demo here: https://du0ui.sse.codesandbox.io/docs/intro

If you use @docusaurus/remark-plugin-npm2yarn and your code snippet is set like this:

```sh npm2yarn
npm init wdio ./foo
```

I would expect that it would transform the yarn version to yarn create wdio ./foo.

Steps to reproduce

  1. create a standard docusarus page
  2. add @docusaurus/remark-plugin-npm2yarn plugin
  3. add example as mention above

Expected behavior

I would expect that it would transform the yarn version to yarn create wdio ./foo.

Actual behavior

It displays npm init wdio ./foo and yarn init wdio ./foo which results in the attempt of creating a new yarn package rather than running the create-wdio starter package.

Your environment

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

Reproducible demo

https://codesandbox.io/s/nice-fire-du0ui?file=/docusaurus.config.js

Self-service

  • I’d be willing to fix this bug myself.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Josh-Cenacommented, Nov 3, 2021

We are aware of this: https://github.com/facebook/docusaurus/pull/5635#issuecomment-937806707

However, we use a 3rd party dep under the hood which is currently unmaintained. I’m discussing with others about what’s the best option. I would prefer forking npm2yarn considering it’s quite lightweight.

1reaction
slorbercommented, Dec 8, 2021

Thanks 👍

Will maintain the fork under my own name (easier to transfer later to a potential docusaurus-core org that I’m asking for) and publish under @docusaurus org (also a security concern).

Read more comments on GitHub >

github_iconTop Results From Across the Web

yarn init
Interactively creates or updates a package.json file. yarn init. This command walks you through an interactive session to create a package.json file.
Read more >
npm2yarn - npm
A command-line tool for converting projects that use `npm`, [`npm-shrinkwrap`](https://www.npmjs.com/package/npm-shrinkwrap) (Uber's package ...
Read more >
@docusaurus/remark-plugin-npm2yarn - npm package | Snyk
Remark plugin for converting npm commands to Yarn commands as tabs. For more information about how to use this package see README.
Read more >
npm:npm2yarn | Skypack
A command-line tool for converting projects that use npm, npm-shrinkwrap (Uber's package for shrinkwrapping), and/or npm-shrinkwrap-check to Yarn.
Read more >
NPM vs Yarn Cheat Sheet - Red Shift - Infinite Red
Okay, so you've heard about this new JavaScript package manager called yarn, installed it with npm i -g yarn, and now you want...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found