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

Error "spawn npm ENOENT" during initial setup via npx storybook-nuxt init #59

Closed
Pecral opened this issue Sep 12, 2023 · 8 comments · Fixed by nuxt-modules/storybook#592

Comments

@Pecral
Copy link

Pecral commented Sep 12, 2023

Environment

Windows 10
node.js 19.1

How to reproduce

Setup new project via:

  • npx nuxi@latest init
  • Choose npm or pnpm (issue occurs in all)
  • Go into folder
  • npx storybook-nuxt init or npx storybook-nuxt@nuxt init
    Problem:

PS C:\VisualStudio\nuxt-test\nuxt-app> npx storybook-nuxt init
▶ Initializing Storybook configuration...

Install dependencies 📦️

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

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

@chakAs3
Copy link
Contributor

chakAs3 commented Sep 12, 2023

hi @Pecral is it possible for you to use pnpm instead, as it is fast and convenient.

@Pecral
Copy link
Author

Pecral commented Sep 12, 2023

Hi @chakAs3, sadly I also have the issue in pnpm, as described above.
See:
PS C:\VisualStudio\storybook-nuxt> cd nuxt-app
PS C:\VisualStudio\storybook-nuxt\nuxt-app> npx storybook-nuxt init
▶ Initializing Storybook configuration...

Install dependencies 📦️

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

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

Node.js v19.1.0

@chakAs3
Copy link
Contributor

chakAs3 commented Sep 13, 2023

@Pecral can please create a repro repo for me so i can check it out

@Pecral
Copy link
Author

Pecral commented Sep 13, 2023

It seems to be related to windows, as I don't have this issue on my macos machine. Will investigate further - a colleague of mine had the same issue on his windows machine

@chakAs3
Copy link
Contributor

chakAs3 commented Sep 15, 2023

It seems to be related to windows, as I don't have this issue on my macos machine. Will investigate further - a colleague of mine had the same issue on his windows machine

yes i will be looking at it thx for the support

@Lustach
Copy link

Lustach commented Oct 19, 2023

Have you made any progress in solving the problem? This will help a lot.

@chakAs3
Copy link
Contributor

chakAs3 commented Oct 20, 2023

Please check https://storybook.nuxtjs.org/examples

@oscarhandsome
Copy link

The same, followed by this https://storybook.nuxtjs.org/getting-started/setup
"nuxt": "^3.11.2"

`$ npx storybook-nuxt init
Directory is not empty
▶ Initializing Storybook configuration...

Install dependencies 📦️

ℹ 🔌 enableModule false 18:11:42
node:events:491
throw er; // Unhandled 'error' event
^

Error: spawn pnpm ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:485:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
at onErrorNT (node:internal/child_process:485:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn pnpm',
path: 'pnpm',
spawnargs: [ 'install' ]
}`

tobiasdiez added a commit to nuxt-modules/storybook that referenced this issue Jun 16, 2024
Instead of invoking the storybook cli, we now start the storybook dev
server in the same process as the nuxt dev server.
This has the advantage that we don't need to spawn a second nuxt
instance, improving preformance and reducing complexifty.

Fixes storybook-vue/storybook-nuxt#59 and
fixes #610 and fixes
#635 and fixes
#475.
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.

4 participants