storybook: [Bug]: Error installing storybook in monorepo

Describe the bug

Error installing storybook in monorepo

Node - v18.13.0

NPM - 9.3.1

When running the command:

npx storybook init

or

npx storybook init --builder @storybook/builder-vite --type react --use-npm

this error occurs:

errro

To Reproduce

No response

System

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 21 (4 by maintainers)

Most upvoted comments

Having the same issue I see it was tagged with “has workaround”, I hope the workaround is not “use a no longer manteined version of node” cause I don’t see any

I am getting the same error while using turborepo with npm and nextjs. My dependencies are installing but when I start the dev server I see the following.

image
0 verbose cli /Users/jpetrillo/Library/Application Support/fnm/node-versions/v18.15.0/installation/bin/node /Users/jpetrillo/Library/Caches/fnm_multishells/12304_1678801214413/bin/npm
1 info using npm@9.6.1
2 info using node@v18.15.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 0ms
5 timing config:load:file:/Users/jpetrillo/Library/Application Support/fnm/node-versions/v18.15.0/installation/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 0ms
8 timing config:load:env Completed in 1ms
9 info found workspace root at /Users/jpetrillo/Documents/Projects/with-npm
10 timing config:load:file:/Users/jpetrillo/Documents/Projects/with-npm/.npmrc Completed in 0ms
11 timing config:load:project Completed in 3ms
12 timing config:load:file:/Users/jpetrillo/.npmrc Completed in 0ms
13 timing config:load:user Completed in 0ms
14 timing config:load:file:/Users/jpetrillo/Library/Application Support/fnm/node-versions/v18.15.0/installation/etc/npmrc Completed in 0ms
15 timing config:load:global Completed in 0ms
16 timing config:load:setEnvs Completed in 1ms
17 timing config:load Completed in 6ms
18 timing npm:load:configload Completed in 6ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm config get registry
22 verbose argv "config" "get" "registry"
23 timing npm:load:setTitle Completed in 5ms
24 timing config:load:flatten Completed in 2ms
25 timing npm:load:display Completed in 2ms
26 verbose logfile logs-max:10 dir:/Users/jpetrillo/.npm/_logs/2023-03-14T13_40_45_696Z-
27 verbose logfile /Users/jpetrillo/.npm/_logs/2023-03-14T13_40_45_696Z-debug-0.log
28 timing npm:load:logFile Completed in 2ms
29 timing npm:load:timers Completed in 0ms
30 timing npm:load:configScope Completed in 0ms
31 timing npm:load Completed in 16ms
32 timing command:config Completed in 1ms
33 verbose stack Error: This command does not support workspaces.
33 verbose stack     at Config.cmdExec (/Users/jpetrillo/Library/Application Support/fnm/node-versions/v18.15.0/installation/lib/node_modules/npm/lib/base-command.js:123:29)
33 verbose stack     at Npm.exec (/Users/jpetrillo/Library/Application Support/fnm/node-versions/v18.15.0/installation/lib/node_modules/npm/lib/npm.js:154:20)
33 verbose stack     at async module.exports (/Users/jpetrillo/Library/Application Support/fnm/node-versions/v18.15.0/installation/lib/node_modules/npm/lib/cli.js:134:5)
34 verbose cwd /Users/jpetrillo/Documents/Projects/with-npm/apps/latest
35 verbose Darwin 22.2.0
36 verbose node v18.15.0
37 verbose npm  v9.6.1
38 error code ENOWORKSPACES
39 error This command does not support workspaces.
40 verbose exit 1
41 timing npm Completed in 22ms
42 verbose code 1
43 error A complete log of this run can be found in:
43 error     /Users/jpetrillo/.npm/_logs/2023-03-14T13_40_45_696Z-debug-0.log

node 18.15.0 npm 9.6.1 turborepo 1.8.3 nextjs 13.2.4

getting the same error, following the turborepo guide at https://turbo.build/repo/docs/handbook/tools/storybook, on node 16.19.1