-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
"storybook init" builds wonky package-lock.json using npm v8 #18298
Comments
Thanks for the reproduction @JohnAlbin -- I can confirm that the repro succeeds with npm6 and fails with npm8. |
@merceyz is this something you can take a look at? |
It looks like it's working with Node 16 + npm 8.5.5, so maybe related to npm 8.5+ 🤔 Update:
|
@JohnAlbin Here's the deal. h/t @ndelangen @yannbf for debugging with me:
If you run without "overrides": {
"webpack": "^5"
} |
@shilman Thanks, Michael! That is some excellent debugging with your team. I've confirmed that the flag you mentioned is also needed when you run npm's
Without the flag, npm refuses to install anything. With the flag, it builds a proper project with a working Storybook instance. It seems to me that the I found this in the
I tested creating the With the
Is this something that |
Thanks @JohnAlbin and thanks for the super clean repro. Can the |
Yes, it needs to be created per-project since the peer-deps setting is a per-project decision. When you run |
Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-alpha.5 containing PR #18510 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Yay!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-alpha.7 containing PR #18522 that references this issue. Upgrade today to the
|
Egads!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.10-alpha.0 containing PR #18522 that references this issue. Upgrade today to the
|
Good golly!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.10 containing PR #18522 that references this issue. Upgrade today to the
|
Wouldn't it be better to keep the bug open until the workaround is no longer needed? The changes adding |
This is not a fix, it's just a workaround! Don't close this issue. |
Reporting that the workaround didn't get me too far in the real world. Details and reproduction submitted in #19218 |
The workaround doesn't work for me. It causes @ag-grid-community/vue to be unable to find its peer dependency vue-property-decorator. Here's what I've tried. The result is the same in every case.
I don't get any errors during
Versions:
Honestly I'm a bit confused as to why you'd be so insistent on using a non-standard peer dependency scheme that you'd spend time to add in a workaround instead of just doing like everyone else. Also confused by how you're committing Please standardize your stuff. It's ridiculous that I can't generate a doc because the doc generator has a disagreement with one of my third-party packages about how peer dependencies should work. |
Update: Turns out, the two packages seem to actually agree if you have the latest version of npm. I had updated my Node, but due to this problem, I still had an old version of npm to go with it. I used I'm sorry I went off on you guys. But it might be good to add an error message (with engine-strict maybe?) that you require a specific NPM version to be compatible with other packages? |
unclear why this is closed |
Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.19 containing PR #20456 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
I'm still getting the automigration message after running the command. Is this anticipated? @shilman |
@christopherbauer can you provide more details on what you've done and what happened? As is, I do not have enough information to know what to do. Can you supply a reproduction? |
1. Added storybook dependency. 2. Added .npmrc file because of the issue(storybookjs/storybook#18298)
1. Added storybook dependency. 2. Added .npmrc file because of the issue(storybookjs/storybook#18298) 3. Modified TypeScript config file.
I was just wondering if it should just work or if I would get prompted either way. |
@christopherbauer try running
|
Worked for me with Vue 3, Node 18.12.1 |
Shouldn't this be specified in the quickstart? I had to run npx sb init edit: for vite it's now in the main monorepo 🚀 |
Cc @jonniebigodes i wonder whether we should specify |
same goes for sections like testing, where we tell users to install @storybook/testing-library, @storybook/test-runner and @storybook/jest, which need @next as well |
I'm also seeing the following message after following instructions in the docs:
Environment:
Steps to reproduce:
As a user new to Storybook, I'm left feeling confused. I see several options before me, and I'm not sure which one to choose and why:
Any guidance is appreciated. Thanks! |
Sorry, just getting up to speed here on the release status of v7. Decided that I do want to use the prerelease as v7 looks fantastic. I ended up reverting all changes from
This worked fine and I see |
Hey, I used npx sb@next init works just fine! |
@Faulery it's because of storybook addon-docs. This addon MUST use the same version of react as the user (when the user is using storybook for react)... therefore we needed to make it a peerDependency. In the past we added react as a dependency to the angular framework, but there was no real dependency-graph connection between addon-docs and the angular framework. The entire team dreaded doing this, but it was own only real option. The other option was to split addon docs into multiple packages, and that would have had very bad affects on it's documentation, backwards compatibility and also importantly: maintenance. I hope this explains the situation + our reasoning. |
Confirming that this solution also worked for me 🚀 Environment:
|
thanks @jadurani -- works for me |
Describe the bug
When using React v18 and npm v8, the
storybook init
command command creates an invalidpackage-lock.json
that no one else can use to create a properly-running Storybook installation.To Reproduce
I tried using
npx sb@next repro
but that forces the usage of yarn and this is an npm-related bug. Because of deployment system constraints, I have to use npm.Fortunately, the steps to reproduce are very simple though and I've added the resulting files to a Git repo.
npm init -y
to create a package.json in the current directory.npm install react react-dom
installs React 18.1.0 93df36fnpx storybook init -N --builder webpack5 --type react
to install Storybook 6.5.3 77d78d0The resulting installation works fine;
npm run storybook
builds fine and all default Storybook pages render correctly.BUT, the
package-lock.json
cannot be reused (not by yourself when adding more dependencies, nor by a CI system, nor by another dev using a Git clone). If you runnpm ci
, it will report the following error:That means that no one else will be able to use that package-lock.json to get the same set of packages currently installed.
Running
npm install
changes thepackage-lock.json
file (61bcd0f) but MDX files no longer render correctly (see #18266).System
Environment Info:
Additional context
The full error message when running
npm ci
is:The text was updated successfully, but these errors were encountered: