Reputation: 159
PS C:..project\src\features> npm run storybook
> [email protected] storybook
> start-storybook -p 6006
'start-storybook' is not recognized as an internal or external command,
operable program or batch file.
Installed storybook but can't seem to make it run. I tried npm install, will not help.
npm: '8.1.0', node: '16.13.0' "react": "^17.0.1",
Upvotes: 9
Views: 22799
Reputation: 15978
Storybook may not have actually been loaded into your node_modules
folder.
After installing storybook using a utility like npx storybook@latest
, you then must actually load the storybook code into your node_modules
folder. Do this with npm i
if using npm, or running yarn
if using yarn.
Upvotes: 1
Reputation: 51
After running npx sb init
then run npx sb@next automigrate
Then lastly modify your scripts in package.json to:
"storybook": "sb dev",
"build-storybook": "sb build"
Upvotes: 5
Reputation: 41
I had the same problem, all you have to do is change the version of all the storybook packages in package.jscon to the same version (preferably to the lowest version that any package has, for example all packages have version 7.2.04 and one has 6.5.16 then you change it to 6.5.16) then you remove node_modules and package-lock.json and then npm or yarn and it should be fine
Upvotes: 3
Reputation: 159
Apparently the node version had to be downgraded to 14.15.0. After that I did rm -rf node_modules
and then npm install
. Since I am using Windows, before changing node version, I had to install NVM for Windows, then install the right node version and change it in CMD (have to run as Administrator).
Upvotes: 5