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

Unable to start nuxt3 storybook project on windows #475

Closed
gab9281 opened this issue Feb 2, 2024 · 9 comments · Fixed by #592
Closed

Unable to start nuxt3 storybook project on windows #475

gab9281 opened this issue Feb 2, 2024 · 9 comments · Fixed by #592

Comments

@gab9281
Copy link

gab9281 commented Feb 2, 2024

node version : 20.11.0
yarn version : 1.22.21
windows version : 23H2 (22631.3085)

Step to reproduce :

  • Create nuxt3 repository using npx nuxi@latest init
  • Select yarn as package manager
  • add storybook using yarn add -D @nuxtjs/storybook
  • Add nuxt config :
  modules: [
    '@nuxtjs/storybook',
  ],
  storybook: {
    url: 'http://localhost:6006',
    storybookRoute: '/__storybook__',
    port: 6006,
  },
  • yarn run dev

Result :

node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: spawn yarn ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484: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:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn yarn',
  path: 'yarn',
  spawnargs: [ 'install' ]
}

Try to identify the situation :

  • Do the same steps but in wsl-ubuntu
  • WORKS !
  • Copy the dependencies :
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "storybook": "7.6.7",
    "@types/node": "^18.17.5",
    "@storybook/vue3": "7.6.7",
    "@storybook-vue/nuxt": "0.2.1",
    "@nuxtjs/storybook": "7.0.0",
    "@storybook/addon-links": "7.6.7",
    "@storybook/builder-vite": "7.6.7",
    "@storybook/addon-essentials": "7.6.7",
    "@storybook/addon-interactions": "7.6.7",
    "@storybook/testing-library": "^0.2.0",
    "@storybook/blocks": "7.6.7"
  • run yarn install

Result : same error

node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: spawn yarn ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484: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:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn yarn',
  path: 'yarn',
  spawnargs: [ 'install' ]
}

2nd resolution try :

  • Upgrade yarn
    • admin console : corepack enable
    • yarn set version stable ( v 4.1.0 )
    • yarn install
    • yarn run dev : Works ...

I've been working a full day on this previously @ job (4 days ago) and had a esbuild-arm error at theses steps.
I am still posting this due to being helpfull for those stuck @ step1 but i'm confused.

While being there :
The page : https://nuxt.com/modules/storybook have different steps to reproductions and is misleading to another repository : https://github.com/storybook-vue/storybook-nuxt.

Which is the official implementation ?

@1337doctor
Copy link

1337doctor commented Feb 2, 2024

Had the same issue.
It seems that this line of code might cause the problems. spawn(cmd, [], { shell: true ... }); setting shell to true could fix this. I haven't verified this. But I had the same issue spawning processes on windows in some other script.

@ilya21743
Copy link

Same problem.
Node v20.11.1
npm v10.4.0
Windows 22H2 (19045.4046)

@Matheun
Copy link

Matheun commented Mar 7, 2024

Same issue here, its like @1337doctor said, i get the same error:

Directory is not empty
▶ Initializing Storybook configuration...

Install dependencies 📦️

ℹ 🔌 enableModule false 16:31:44
node:events:495
throw er; // Unhandled 'error' event
^

Error: spawn npm ENOENT
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: -4058,
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'install' ]
}

@sefacndmr01
Copy link

any updates ?

2 similar comments
@FrankoFM
Copy link

FrankoFM commented Apr 3, 2024

any updates ?

@AdamovichArtur
Copy link

any updates ?

@MarlonWiss2212
Copy link

same problem here. any updates?

@OliverGamborg
Copy link

Also experiencing this error, any workaround or updates?

@thomscholtens
Copy link

Any updates on this? It is still not working on windows after the last update

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

Successfully merging a pull request may close this issue.

10 participants