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

[Bug]: Archlinux, Svelte, Unable to find versions of @storybook/cli using npm #27236

Closed
alemNative opened this issue May 23, 2024 · 9 comments
Closed

Comments

@alemNative
Copy link

Describe the bug

Since i wanna update to Storybook 8 i get this error. tyin to install the cli globaly, set the ownership and so on to the user but noring helps.

Reproduction link

localhost

Reproduction steps

just try to install with the command npx sb init

System

Archliniux

Additional context

npx sb init
Error: Unable to find versions of @storybook/cli using npm
at NPMProxy.runGetVersions (/usr/lib/node_modules/@storybook/cli/node_modules/@storybook/core-common/dist/index.js:37:639)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async doInitiate (/usr/lib/node_modules/@storybook/cli/dist/generate.js:146:992)
at async withTelemetry (/usr/lib/node_modules/@storybook/cli/node_modules/@storybook/core-server/dist/index.js:28:3599)
at async initiate (/usr/lib/node_modules/@storybook/cli/dist/generate.js:180:245)

attention => Storybook now collects completely anonymous telemetry regarding usage.
This information is used to shape Storybook's roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://storybook.js.org/telemetry

@mariowenak
Copy link

It's an issue with the NPM version. I upgraded to 10.8 and also encountered this issue. Just adjust the NPM version to 10.5 and below

@mmorozov-noltic
Copy link

I had the same issue. Thanks @mariowenak, I downgraded npm version to 10.5 and now it is working

@alex-ahumada
Copy link
Contributor

This also happens in macOS with init and upgrade commands. Downgrading npm to 10.5 fixes the error.

@sainu
Copy link

sainu commented May 28, 2024

I had the same issue with node v22.1.0 and npm v10.8.0. Downgrading node to v20.x and npm to 10.5 fixes the error. Downgrading only npm to 10.5 did not fix it.

node --version
v22.1.0

npm --version
10.8.0

npx storybook@latest upgrade
(node:71001) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
WARN An issue occurred while trying to find dependencies metadata using npm.
Error: Unable to find versions of @storybook/cli using npm
    at NPMProxy.runGetVersions (/Users/saino.katsutoshi/.npm/_npx/bc7e1e37fcb46ffc/node_modules/@storybook/core-common/dist/index.js:37:639)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async doUpgrade (/Users/saino.katsutoshi/.npm/_npx/bc7e1e37fcb46ffc/node_modules/@storybook/cli/dist/generate.js:643:2214)
    at async withTelemetry (/Users/saino.katsutoshi/.npm/_npx/bc7e1e37fcb46ffc/node_modules/@storybook/core-server/dist/index.js:28:3599)
    at async upgrade (/Users/saino.katsutoshi/.npm/_npx/bc7e1e37fcb46ffc/node_modules/@storybook/cli/dist/generate.js:650:2097)

@CurlyDev1
Copy link

Is there a fix for this ?

I'm seeing the error when running npx storybook@8.1.4 init

Environment details
OS: Ubuntu 22.04.4
Node: v20.12.2
NPM: v10.5.0

Looking at the source file https://github.com/storybookjs/storybook/blob/v8.1.4/code/lib/core-common/src/js-package-manager/NPMProxy.ts#L244 it tries to parse the result as JSON, but if searching for a single version would always return a single string which might be the reason it is failing.

Not sure if that's an issue with the npm info command with the --json flag as the following just returns a string rather than json

npm info storybook version --json
"8.1.4"

@CurlyDev1
Copy link

ignore me, I somehow had npm@10.8.0 installed in my dependencies for my project

@ghost23
Copy link

ghost23 commented May 30, 2024

I installed all kinds of different versions now, but I keep getting the error. Had npm 10.2.4, 10.7.0, 10.5.0

@valentinpalkovic
Copy link
Contributor

It seems the issue is resolved in npm@10.8.1. Could someone please verify this?

@Bazyli12
Copy link

Bazyli12 commented Jun 1, 2024

It seems the issue is resolved in npm@10.8.1. Could someone please verify this?

image

npm i -g npm@10.8.1

seems to be working

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

No branches or pull requests

10 participants