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] pnpm install fails with "No matching version found for @storybook/addon-styling-webpack@^7.3.2" #2

Closed
ar4hc opened this issue Aug 25, 2023 · 11 comments · Fixed by storybookjs/storybook#23956 or storybookjs/storybook#24079
Labels
bug Something isn't working

Comments

@ar4hc
Copy link

ar4hc commented Aug 25, 2023

Describe the bug

Trying to upgrade and just do just this:

# pnpm dlx storybook@latest add @storybook/addon-styling-webpack                                                               
.../share/pnpm/store/v3/tmp/dlx-16529    | +616 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.../share/pnpm/store/v3/tmp/dlx-16529    | Progress: resolved 637, reused 616, downloaded 0, added 616, done
Verifying @storybook/addon-styling-webpack
Installing @storybook/addon-styling-webpack@^7.3.2

An error occurred while installing dependencies:
PNPM error ERR_PNPM_NO_MATCHING_VERSION  No matching version found for @storybook/addon-styling-webpack@^7.3.2

Please check the logfile generated at ./storybook.log for troubleshooting and try again.
/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-16529/node_modules/.pnpm/@storybook+cli@7.3.2/node_modules/@storybook/cli/dist/generate.js:54
An error occurred while installing dependencies:`),logger4.log(e.message),new HandledError(e)}}async removeDependencies(options,dependencies){let{skipInstall}=options;if(skipInstall){let{packageJson}=options;dependencies.forEach(dep=>{packageJson.devDependencies&&delete packageJson.devDependencies[dep],packageJson.dependencies&&delete packageJson.dependencies[dep]}),await this.writePackageJson(packageJson)}else try{await this.runRemoveDeps(dependencies)}catch(e){throw logger4.error("An error occurred while removing dependencies."),logger4.log(e.message),new HandledError(e)}}getVersionedPackages(packages){return Promise.all(packages.map(async pkg2=>{let[packageName,packageVersion]=getPackageDetails(pkg2);return`${packageName}@${await this.getVersion(packageName,packageVersion)}`}))}getVersions(...packageNames){return Promise.all(packageNames.map(packageName=>this.getVersion(packageName)))}async getVersion(packageName,constraint){let current;/(@storybook|^sb$|^storybook$)/.test(packageName)&&(current=versions_default[packageName]);let latest;try{latest=await this.latestVersion(packageName,constraint)}catch(e){if(current)return logger4.warn(`
                                                                          ^

HandledError: PNPM error ERR_PNPM_NO_MATCHING_VERSION  No matching version found for @storybook/addon-styling-webpack@^7.3.2

Please check the logfile generated at ./storybook.log for troubleshooting and try again.
    at PNPMProxy.addDependencies (/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-16529/node_modules/.pnpm/@storybook+cli@7.3.2/node_modules/@storybook/cli/dist/generate.js:54:75)
    at async add (/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-16529/node_modules/.pnpm/@storybook+cli@7.3.2/node_modules/@storybook/cli/dist/generate.js:127:1955) {
  handled: true,
  cause: Error: PNPM error ERR_PNPM_NO_MATCHING_VERSION  No matching version found for @storybook/addon-styling-webpack@^7.3.2

  Please check the logfile generated at ./storybook.log for troubleshooting and try again.
      at PNPMProxy.runAddDeps (/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-16529/node_modules/.pnpm/@storybook+cli@7.3.2/node_modules/@storybook/cli/dist/generate.js:58:5082)
      at async PNPMProxy.addDependencies (/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-16529/node_modules/.pnpm/@storybook+cli@7.3.2/node_modules/@storybook/cli/dist/generate.js:53:853)
      at async add (/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-16529/node_modules/.pnpm/@storybook+cli@7.3.2/node_modules/@storybook/cli/dist/generate.js:127:1955)
}

Node.js v20.5.1

the logfile mentioned looks like

Progress: resolved 0, reused 1, downloaded 0, added 0
Progress: resolved 86, reused 86, downloaded 0, added 0
 ERR_PNPM_NO_MATCHING_VERSION  No matching version found for @storybook/addon-styling-webpack@^7.3.2

This error happened while installing a direct dependency of /Users/ar/src/lincare/classifier/classifier-gui

The latest release of @storybook/addon-styling-webpack is "0.0.2".

If you need the full list of all 2 published versions run "$ pnpm view @storybook/addon-styling-webpack versions".

Steps to reproduce the behavior

  1. be stupid and run pnpm dlx ...

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots and/or logs

If applicable, add screenshots and/or logs to help explain your problem.

Environment

  • OS: Mac OSX 13.4.1
  • Node.js version: v20.5.1
  • pNPM version: 8.6.12

Additional context

i'm stupid...

Just tried to install this on top of an existing 7.0 installation...

@ar4hc ar4hc added the bug Something isn't working label Aug 25, 2023
@ShaunEvening
Copy link
Contributor

ShaunEvening commented Aug 25, 2023

Hey @ar4hc 👋

You're not stupid at all! You just bumped into a rough edge that I missed 😭

I'm going to make a fix for the add command but in the mean time you can get around it by running this instead:

pnpm dlx storybook@latest add @storybook/addon-styling-webpack@latest

@ar4hc
Copy link
Author

ar4hc commented Aug 30, 2023

Thanks for the quick response, ...
but ...
i got an other error now: :(

(And i needed to remove the first "@", but i assume that was just a typo?)

 pnpm dlx storybook@latest add @storybook/addon-styling-webpack@latest                                                         
.../share/pnpm/store/v3/tmp/dlx-9415     | +620 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.../share/pnpm/store/v3/tmp/dlx-9415     | Progress: resolved 641, reused 620, downloaded 0, added 620, done
Verifying @storybook/addon-styling-webpack
Installing @storybook/addon-styling-webpack@latest
Adding '@storybook/addon-styling-webpack@latest' to main.js addons field.
Running postinstall script for @storybook/addon-styling-webpack
Error running postinstall script for @storybook/addon-styling-webpack
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:405:5)
    at validateString (node:internal/validators:162:11)
    at normalizeSpawnArguments (node:child_process:547:3)
    at Object.spawn (node:child_process:752:13)
    at t (/Users/ar/src/lincare/classifier/classifier-gui/node_modules/.pnpm/@storybook+addon-styling-webpack@0.0.2_webpack@5.88.2/node_modules/@storybook/addon-styling-webpack/bin/postinstall.js:5:112)
    at postinstallAddon (/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-9415/node_modules/.pnpm/@storybook+cli@7.4.0/node_modules/@storybook/cli/dist/generate.js:172:834)
    at add (/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-9415/node_modules/.pnpm/@storybook+cli@7.4.0/node_modules/@storybook/cli/dist/generate.js:172:2421) {
  code: 'ERR_INVALID_ARG_TYPE'
}

i think he misses a file, and as it mention 'main.js' i assume something in '.storybook' , which has a main.js, preview.js and a preview-head.html (with just makes a window.global = window;

And i'm on mac (intel) if that makes a difference...

Any quick tips...?

@ShaunEvening
Copy link
Contributor

Hey @ar4hc 👋

Oops! yes, that was a typo.

As for your new error, that should be solved with version 0.0.3 which I just published for you

@ar4hc
Copy link
Author

ar4hc commented Aug 30, 2023

But still the same error... :(

$ pnpm dlx storybook@latest add @storybook/addon-styling-webpack                                                           
.../share/pnpm/store/v3/tmp/dlx-20359    | +620 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.../share/pnpm/store/v3/tmp/dlx-20359    | Progress: resolved 641, reused 619, downloaded 1, added 620, done
Verifying @storybook/addon-styling-webpack
Installing @storybook/addon-styling-webpack@^0.0.3
Adding '@storybook/addon-styling-webpack' to main.js addons field.
Running postinstall script for @storybook/addon-styling-webpack
Error running postinstall script for @storybook/addon-styling-webpack
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:405:5)
    at validateString (node:internal/validators:162:11)
    at normalizeSpawnArguments (node:child_process:547:3)
    at Object.spawn (node:child_process:752:13)
    at t (/Users/ar/src/lincare/classifier/classifier-gui/node_modules/.pnpm/@storybook+addon-styling-webpack@0.0.3_webpack@5.88.2/node_modules/@storybook/addon-styling-webpack/bin/postinstall.js:5:130)
    at postinstallAddon (/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-20359/node_modules/.pnpm/@storybook+cli@7.4.0/node_modules/@storybook/cli/dist/generate.js:172:834)
    at add (/Users/ar/.local/share/pnpm/store/v3/tmp/dlx-20359/node_modules/.pnpm/@storybook+cli@7.4.0/node_modules/@storybook/cli/dist/generate.js:172:2421) {
  code: 'ERR_INVALID_ARG_TYPE'

probably cache problem,
but states 0.0.3 as version, and even the same line numbers..

@wonkeythemonkey
Copy link

I'm encountering the same error, and I never had any version besides 0.0.3 installed, so it doesn't sound like a cache issue.

@ShaunEvening ShaunEvening reopened this Aug 31, 2023
@ShaunEvening
Copy link
Contributor

Oh no! I'll dig in right now

@ShaunEvening
Copy link
Contributor

@wonkeythemonkey @ar4hc Are you by chance running this in a project without git?

I was able to reproduce the error when I couldn't find a git repository and just pushed a fix for that

@ShaunEvening
Copy link
Contributor

Work-around

Looks like there's still a problem between the storybook CLI and the config helper.

To get you set up run the following command instead

npx @stoybook/auto-config styling

@wonkeythemonkey
Copy link

wonkeythemonkey commented Aug 31, 2023

I am running it in an environment where Storybook assets are being pulled together from different directories (long story), so even though there is a git repo, it's probably not where the addon expects it to be.
I'm also running it inside a Docker container, which wouldn't have a git repo inside it.

Edit for clarity: I've tried running it both in and outside of Docker, with the same result.

@ar4hc
Copy link
Author

ar4hc commented Sep 5, 2023

@wonkeythemonkey @ar4hc Are you by chance running this in a project without git?

Nope, it is in a git repo...

@ar4hc
Copy link
Author

ar4hc commented Sep 5, 2023

oh, and info i missed before... 😢

  • ist a pnpm project
  • using svelte with vite as packer, not webpack.

The work around tries to install

 I'm the configuration helper for "@storybook/addon-styling-webpack"!

and then complains (correctly)


╔ 🚨 ERROR: Unsupported builder ═════════════════════════════════════════╗
║                                                                        ║
║   "@storybook/addon-styling-webpack" is for webpack projects only.     ║
║   Please remove it from your project to avoid unneeded dependencies.   ║
║                                                                        ║
╚════════════════════════════════════════════════════════════════════════╝

So i tried to install a webpack addon into a vite project... 🤦🏻
my bad...

Sorry for wasting your time...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants