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

Different behaviours with yarn and npm installs #276

Closed
psyked opened this issue Aug 31, 2018 · 4 comments
Closed

Different behaviours with yarn and npm installs #276

psyked opened this issue Aug 31, 2018 · 4 comments

Comments

@psyked
Copy link

psyked commented Aug 31, 2018

Bug Report

Describe the bug

When installing via npm, the TOC / submenu items don't appear in the docz output, but when installing via yarn, they do appear. I'm sure this is related to issues such as #206.

I'm using version 0.10.3 but during my debugging I've also seen it on older versions. I've been able to reliably reproduce it using the steps below.

To Reproduce

  1. Have a simple project with headings in mdx files
  2. Run npm install, and docz dev
  3. Headings don't appear as a submenu item
  4. Stop project
  5. Remove node_modules, purge any lockfiles
  6. Run yarn install and docz dev
  7. Headings do appear as submenu item

If yarn installs, everything's groovy. If npm installs, things are broken.

Expected behavior

NPM and Yarn should install the same packages, or at least the NPM one works properly.

Environment

  • OS: OSX High Sierra
  • Node/npm version: Node 10.7.0 / NPM 6.4.0 / Yarn 1.9.4

Additional context/Screenshots
I assume this is due to package versions way down the chain being resolved differently, but I have no idea where to start.

@rhberro
Copy link

rhberro commented Sep 1, 2018

It looks like the developers have chosen Yarn as it package manager, also, the whole documentation tells you to use it. As you can see here managing both might be cumbersome and the two files (package-lock.json and yarn.lock) might get out-of-sync.

Note that there is also an open closed issue (with many +1s) suggesting that Yarn support package-lock.json, which would solve this dilemma. EDIT: that issue was closed and the discussion moved to an issue about conflicting lockfile UX problems. So watch that space.

If you are still thinking that a project should support both package managers, this is a message that Yarn throws into the console when you try to install a project's dependencies with Yarn and there is a package-lock.json file:

yarn install v1.9.4
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

Hope it helps.

@lttb
Copy link
Contributor

lttb commented Sep 12, 2018

looks like this issue is also related to #247

@psyked
Copy link
Author

psyked commented Sep 12, 2018

@lttb I suspect so. I had thought npm and yarn were interchangeable, but this is the first time I've actually seen using different tools result in different behaviours in the output.

I'm going to close this, as I don't think there's an appetite for figuring out how to make this work the same with npm installs.

@psyked psyked closed this as completed Sep 12, 2018
@diondiondion
Copy link

I'm going to close this, as I don't think there's an appetite for figuring out how to make this work the same with npm installs.

I think it should be kept open & looked into, seems pretty weird to require yarn for correct functionality without stating that anywhere. After all, the docz documentation only states the following (bolded bit added by me):

First, you need to install docz on your project using some package manager (we're assuming Yarn here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants