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] CLI error #6

Open
CilooW opened this issue Sep 19, 2023 · 16 comments · Fixed by storybookjs/addon-styling-webpack#8
Open

[Bug] CLI error #6

CilooW opened this issue Sep 19, 2023 · 16 comments · Fixed by storybookjs/addon-styling-webpack#8
Assignees
Labels
bug Something isn't working

Comments

@CilooW
Copy link

CilooW commented Sep 19, 2023

Describe the bug

I want to change preset/scss in my projet , with this addon. I installed the storybook CLI. Then, I get an error when installing addon with the Storybook CLI

Steps to reproduce the behavior

  1. run the command npx storybook@latest add @storybook/addon-styling-webpack
  2. see error "spawn npw ENOENT" ( spawnargs: ['@storybook/auto-config', 'styling' ] )

Expected behavior

I should have the new addon installed

Screenshots and/or logs

image

Environment

  • OS: Windows 11
  • Node.js version: v16.14.2
  • NPM version: 8.5.0
  • Browser (if applicable): chrome
  • Browser version (if applicable): V116.0

Additional context

I look for a simple solution to uninstall preset/scss and have something else in my package to handle scss preprocessing, as I run into scss duplicating, especially for the global part... and I was hoping maybe this addon could help me resolve my problems :) .

@CilooW CilooW added the bug Something isn't working label Sep 19, 2023
@CilooW
Copy link
Author

CilooW commented Sep 19, 2023

additionnal information, I tried this but not effective :
image
it just... terminate the task, like this

@ecoms-ye
Copy link

ecoms-ye commented Sep 25, 2023

same error in macOS with pnpm (in a next.js app):

  throw error;
  ^

Error: spawn pnpm dlx ENOENT
    at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
    at __node_internal_errnoException (node:internal/errors:623:12)
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:290:12)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pnpm dlx',
  path: 'pnpm dlx',
  spawnargs: [ '@storybook/auto-config', 'styling' ]
}

Node.js v18.18.0

@maciej-jezierski
Copy link

maciej-jezierski commented Sep 25, 2023

Same here MacOS. Fresh installation of storybook

  • Version based on Vue
.../Library/pnpm/store/v3/tmp/dlx-30243  |  WARN  deprecated @babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2
.../Library/pnpm/store/v3/tmp/dlx-30243  |  WARN  deprecated @babel/[email protected]
.../Library/pnpm/store/v3/tmp/dlx-30243  |  WARN  deprecated @babel/[email protected]
.../Library/pnpm/store/v3/tmp/dlx-30243  |  WARN  deprecated @babel/[email protected]
.../Library/pnpm/store/v3/tmp/dlx-30243  | +617 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.../Library/pnpm/store/v3/tmp/dlx-30243  | Progress: resolved 638, reused 617, downloaded 0, added 617, done
Verifying @storybook/addon-styling-webpack
Installing @storybook/addon-styling-webpack@^0.0.4
Adding '@storybook/addon-styling-webpack' to main.js addons field.
Running postinstall script for @storybook/addon-styling-webpack
/Users/maciej/Library/pnpm/store/v3/tmp/dlx-30243/node_modules/.pnpm/@[email protected]/node_modules/@storybook/cli/bin/index.js:23
  throw error;
  ^

Error: spawn pnpm dlx ENOENT
    at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
    at __node_internal_errnoException (node:internal/errors:620:12)
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pnpm dlx',
  path: 'pnpm dlx',
  spawnargs: [ '@storybook/auto-config', 'styling' ]
}

Node.js v18.14.0
 ERROR  Command failed with exit code 7: storybook add @storybook/addon-styling-webpack```

@ShaunEvening
Copy link
Contributor

Hey everyone! Sorry about the wait.

I've been away for a few weeks and trying to get back on top of my notifications. I'll dive into this over the next few days to see what's happening.

@ShaunEvening ShaunEvening self-assigned this Sep 26, 2023
@maciej-jezierski
Copy link

My case is solved. I used Tailwind and seems this package is not supporting it. Moving to: @storybook/addon-themes solved it.

Mistake comes from deprecated package description:
https://github.com/storybookjs/addon-styling

Error message could be more intuitive

@ShaunEvening
Copy link
Contributor

Hey @CilooW I just published a fix that should solve your problem on Windows. Can you give 0.0.5 a try?

@CilooW
Copy link
Author

CilooW commented Oct 13, 2023

@integrayshaun unfortunately, I installed manually the addon by copying the line in my package.json, because the install with cli didn't work (npm, says no target found, as if the package didn't exist).
then when I call the auto-config, I have the same problem than above ^^"

@ShaunEvening
Copy link
Contributor

Hey @CilooW I'm sorry that this is still a problem for you :( despite the error being the same, can you share the output with me? I just want to confirm that your machine isn't using an old cache from the previous npx attempts.

@CilooW
Copy link
Author

CilooW commented Oct 16, 2023

I did a npm cache clean --force before writing this message of course :)
here are my attemps with the auto-config :
image

@CilooW
Copy link
Author

CilooW commented Oct 16, 2023

and then for the fact that I couldn't install the package and had to instally it manually :
image

@ShaunEvening ShaunEvening reopened this Oct 16, 2023
@ShaunEvening
Copy link
Contributor

@CilooW that's odd. it shouldn't be trying to install v7.1.1 of the styling-webpack addon because we're only on version 0.0.5

This tells me that your npx command is using version 7.1.1 of storybook instead of the latest which was 7.4.6 when you sent this 🤔

@jacob-granular
Copy link

jacob-granular commented Oct 23, 2023

I get the same issue when running the plugin expecting postcss to be configured, but nothing happens. Im on MacOS and a new install of storybook
image

Storybook Environment Info:

  System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M1
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.6.1 - ~/.nvm/versions/node/v20.6.1/bin/node
    Yarn: 3.6.4 - ~/.nvm/versions/node/v20.6.1/bin/yarn <----- active
    npm: 9.8.1 - ~/.nvm/versions/node/v20.6.1/bin/npm
  Browsers:
    Chrome: 118.0.5993.117
    Safari: 17.0
  npmPackages:
    @storybook/addon-essentials: ^7.5.1 => 7.5.2 
    @storybook/addon-interactions: ^7.5.1 => 7.5.2 
    @storybook/addon-links: ^7.5.1 => 7.5.2 
    @storybook/addon-onboarding: ^1.0.8 => 1.0.8 
    @storybook/addon-styling-webpack: ^0.0.5 => 0.0.5 
    @storybook/addon-themes: ^7.5.1 => 7.5.2 
    @storybook/blocks: ^7.5.1 => 7.5.2 
    @storybook/react: ^7.5.1 => 7.5.2 
    @storybook/react-webpack5: ^7.5.1 => 7.5.2 
    @storybook/testing-library: ^0.2.2 => 0.2.2 
    storybook: ^7.5.1 => 7.5.2 

@ShaunEvening
Copy link
Contributor

@jacob-granular Can you give me more information about your storybook? Copy and paste the result of npx storybook info here

@marciolima-praycom
Copy link

Hey guys! I got the same issue reported by @jacob-granular .. here's the output of npx storybook info:

➜ npx storybook info                                       

Storybook Environment Info:

  System:
    OS: macOS 13.5.2
    CPU: (10) x64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 3.2.1 - ~/.nvm/versions/node/v18.15.0/bin/yarn <----- active
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
  Browsers:
    Chrome: 118.0.5993.117
    Safari: 16.6
  npmPackages:
    @storybook/react-webpack5: ^7.0.2 => 7.5.2 

cc: @integrayshaun

@jacob-granular
Copy link

jacob-granular commented Nov 1, 2023

@integrayshaun I've updated my comment above with the output. The only way i've managed to get storybook working with post-css is to include custom webpack config in ./storybook/main.ts,

async webpackFinal(config, { configType }) {
    return {
      ...config,
      module: {
        ...config.module,
        rules: [
          ...config?.module?.rules!,
          ...[
            {
              test: /\.css$/,
              use: [
                {
                  loader: 'postcss-loader',
                  options: {
                    sourceMap: true,
                  },
                },
              ],
            },
          ],
        ],
      },
    };
  },

@ShaunEvening ShaunEvening transferred this issue from storybookjs/addon-styling-webpack Jan 5, 2024
@lsarni
Copy link

lsarni commented Jan 10, 2024

I got the same issue, I wanted to configure it for styled-components

npx @storybook/auto-config themes
Need to install the following packages:
  @storybook/[email protected]
Ok to proceed? (y) y

╔ 👋 Hi there ════════════════════════════════════════════════════════════════════╗
║                                                                                 ║
║   I'm the configuration helper for "@storybook/addon-themes"!                   ║
║                                                                                 ║
║   Hold on for a moment while I look at your project and get you all set up...   ║
║                                                                                 ║
╚═════════════════════════════════════════════════════════════════════════════════╝


╔ 💬 Before we continue ══════════════════════════════════════════════════════╗
║                                                                             ║
║   It looks like you have uncommitted changes in your git repository.        ║
║                                                                             ║
║   We recommend that you commit or stash them before running this command.   ║
║                                                                             ║
╚═════════════════════════════════════════════════════════════════════════════╝

✔ Do you want to quit? … no
Storybook Environment Info:

  System:
    OS: macOS 13.4
    CPU: (8) arm64 Apple M2
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.17.1/bin/yarn
    npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
    pnpm: 8.6.12 - ~/.nvm/versions/node/v18.17.1/bin/pnpm <----- active
  Browsers:
    Chrome: 120.0.6099.216
    Safari: 16.5
  npmPackages:
    @storybook/addon-essentials: ^7.6.7 => 7.6.7 
    @storybook/addon-interactions: ^7.6.7 => 7.6.7 
    @storybook/addon-links: ^7.6.7 => 7.6.7 
    @storybook/addon-onboarding: ^1.0.10 => 1.0.10 
    @storybook/addon-themes: ^7.6.7 => 7.6.7 
    @storybook/blocks: ^7.6.7 => 7.6.7 
    @storybook/nextjs: ^7.6.7 => 7.6.7 
    @storybook/react: ^7.6.7 => 7.6.7 
    @storybook/test: ^7.6.7 => 7.6.7 
    eslint-plugin-storybook: ^0.6.15 => 0.6.15 
    storybook: ^7.6.7 => 7.6.7

I also tried commiting the uncommitted changes but then it ends without doing anything:

npx @storybook/auto-config themes

╔ 👋 Hi there ════════════════════════════════════════════════════════════════════╗
║                                                                                 ║
║   I'm the configuration helper for "@storybook/addon-themes"!                   ║
║                                                                                 ║
║   Hold on for a moment while I look at your project and get you all set up...   ║
║                                                                                 ║
╚═════════════════════════════════════════════════════════════════════════════════╝

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
Development

Successfully merging a pull request may close this issue.

7 participants