-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Cannot init in a new project #26553
Comments
I think you should |
npx installs the CLI if it isn't already available. Also, nowhere in the getting started guide it is mentioned that the CLI needs to be installed separately before. |
Have you tried clearing your npm cache and running again? |
Yes!
|
Out of curiosity, does this happen if you try to run |
Yes, I even tried that earlier. |
This is really strange. Does this command |
Yes, it does
|
Tried it again with 8.0.2; didn't work
|
Hi there! Thank you for opening this issue, but it has been marked as |
I'm afraid we need to close this issue for now, since we can't take any action without the requested reproduction or additional information. But please don't hesitate to open a new issue if the problem persists – we're always happy to help. Thanks so much for your understanding. |
Thought I should give it a try again and ran into this issue again. This time I tried to debug what's the case. It seems that the execCommand function at this line returns an empty string. The command execution went well. The console logs below proves that. ❯ npx storybook init
"8.0.9" <--- stdio inherit passed to execCommand
{ commandResult: '' } <--- It should have been "8.0.9"
Unexpected end of JSON input <--- json parsing on empty string
Error: Unable to find versions of @storybook/cli using npm |
@shilman Can you please reopen this issue? |
So, I went deep further, and learnt that the stdout from the command is undefined, which is very strange as neither stderr is defined.
{
commandResult: {
command: 'npm info @storybook/cli version --json',
escapedCommand: 'npm info "@storybook/cli" version --json',
exitCode: 0,
stdout: undefined,
stderr: undefined,
all: undefined,
failed: false,
timedOut: false,
isCanceled: false,
killed: false
}
} |
looks like something is wrong with execa. import {execa} from 'execa';
const commandResult = await execa('npm', ['info', '@storybook/cli', 'version', '--json']);
console.log(commandResult); ❯ node testexec.js
{
command: 'npm info @storybook/cli version --json',
escapedCommand: 'npm info "@storybook/cli" version --json',
exitCode: 0,
stdout: '',
stderr: '',
all: undefined,
failed: false,
timedOut: false,
isCanceled: false,
killed: false
} |
@pavitra-infocusp re-opened. so i guess we wait for the resolution in execa? thanks so much for digging in on this. 🙏 |
👋 I am Execa's co-maintainer. From the look of it, I do not think there is a bug with Execa there, but the issue at sindresorhus/execa#995 can track this. In terms of calling Execa in Storybook, I would recommend replacing More details: the
As you can see, the The storybook/code/lib/core-common/src/js-package-manager/JsPackageManager.ts Lines 566 to 574 in 7e1ee32
|
@ehmicky Thanks so much for helping out here (and for maintaining Execa -- you rock!!!). I'm not sure whether we are on Execa v5 out of laziness or there's something specific that's holding us back. I'll check with the team and we'll try to get it upgraded. Hopefully @pavitra-infocusp or one of the other folks who experienced this issue can confirm the fix. 🙏 |
@lfrancke both are installed on my system. |
I wanted to add a comment for those who run into this issue, and unblock themselves potentially. Storybook Environment Info: I downgraded node with nvm to I did see the error reporting an issue with using remix, which is expected. |
I was able to run The storybook then failed to start with this error:
|
@ndelangen my guess is that you don't have .net 8 installed which is required.
Irrespective, it sounds environment related. Is there any more info I can provide to help identify dependency issues? |
In my case, this issue disappeared after a while, and the upgrade/new install works fine now. I think it was somehow fixed in a recent update 🤔 |
Hey everyone, this error seems to be related to a bug in a specific NPM versions (see this confirmation), plus our error handling that didn't really provide much information. In Storybook 8.2 the error message will be updated to contain the full error to assist us in fixing this. In case there is something related other than the NPM bug, we will take a look and fix. If you are still experiencing this issue, please:
|
I've been trying with Node: 20.12.1
EDIT: Despite not even using |
Confirming upgrade to npm 10.8.1 resolved the issue for me, as well. Thank you @yannbf!
|
Confirming, upgrading npm to 10.8.1 resolved the issue when using
|
Updating npm also fixed the issue for me. Thank you team. |
Looks like this has been resolved then! Thanks everyone for confirming the fix. |
I don't know why this still doesn't work for me :( I just started a new React + Vite project and I am still not able to init Storybook.
|
@pavitra-infocusp , last week Storybook |
Nope,
|
I tried using the
|
I just tried again with
|
I'll try to fix and send a PR. |
Still getting the error on Node: 22.0.9
|
I have the same problem, and I can't find any resourse to fix this problem. node version: v20.17 |
Has anyone found a solution? |
also getting this issue, again. |
@vanessayuenn appears that this is still an issue for some users, even on newer versions. |
This might be resolved by upgrading Execa and replacing |
In an empty directory,
I end up having to kill the process. When I do, there are only three files created in Choosing
|
Describe the bug
I am trying to install Storybook in a new project. But when I run
npx storybook@latest init
, it says "Error: Unable to find versions of @storybook/cli using npm"To Reproduce
Run
npx storybook@latest init
System
Additional context
The text was updated successfully, but these errors were encountered: