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

[Storybook 5] Missing script: build-storybook #9760

Closed
Ninita1 opened this issue Feb 5, 2020 · 2 comments
Closed

[Storybook 5] Missing script: build-storybook #9760

Ninita1 opened this issue Feb 5, 2020 · 2 comments

Comments

@Ninita1
Copy link

Ninita1 commented Feb 5, 2020

Describe the bug
When executing npm run storybook-build I always get this error: npm ERR! missing script: build-storybook.
I already upgraded Storybook from version 3 to 5, Babel from 6 to 7 and Webpack from 3 to 4, and already deleted node_modules and package-lock.json thousand times and install everything again and the problem remains. Can someone help me?

To Reproduce
Steps to reproduce the behavior:

  1. Clone or download my repo from https://github.com/Ninita1/storybook5_babel7_webpack4
  2. run npm install
  3. run npm run storybook-build

Expected behavior
The storybook should be built normally and successfully.

Screenshots
log1
log2
log3

Code snippets
My project code: https://github.com/Ninita1/storybook5_babel7_webpack4

package.json:

{
  "name": "@my-company/my-component",
  "scripts": {
    "storybook-build": "npm run build-storybook -c .storybook -o ./dist/my-component/storybook/"
  },
  "dependencies": {
    "prop-types": "^15.7.2",
    "react": "^16.9.0",
    "react-dom": "^16.9.0"
  },
  "devDependencies": {
    "@babel/cli": "7.8.3",
    "@babel/core": "7.8.3",
    "@babel/plugin-proposal-class-properties": "7.8.3",
    "@babel/plugin-proposal-export-namespace-from": "7.8.3",
    "@babel/plugin-proposal-throw-expressions": "7.8.3",
    "@babel/plugin-syntax-dynamic-import": "7.8.3",
    "@babel/plugin-transform-runtime": "7.8.3",
    "@babel/preset-env": "7.8.3",
    "@babel/preset-react": "7.8.3",
    "@babel/runtime-corejs2": "7.8.3",
    "@storybook/addon-actions": "5.3.9",
    "@storybook/addon-docs": "5.3.9",
    "@storybook/addon-options": "5.3.9",
    "@storybook/components": "5.3.9",
    "@storybook/react": "5.3.9",
    "babel-eslint": "^10.0.3",
    "babel-jest": "^24.9.0",
    "babel-loader": "^8.0.6",
    "babel-minify": "^0.5.1",
    "clean-webpack-plugin": "^0.1.17",
    "copy-webpack-plugin": "^4.5.3",
    "cross-env": "^7.0.0",
    "css-loader": "^3.4.2",
    "enzyme": "^3.10.0",
    "enzyme-adapter-react-16": "^1.14.0",
    "enzyme-to-json": "^3.4.0",
    "eslint": "^5.16.0",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-loader": "^2.1.2",
    "eslint-plugin-import": "^2.18.2",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react": "^7.14.3",
    "extract-text-webpack-plugin": "^4.0.0-beta.0",
    "file-loader": "^5.0.2",
    "jest": "^24.9.0",
    "jest-environment-jsdom": "^25.1.0",
    "jest-html-reporters": "^1.2.1",
    "js-beautify": "^1.10.2",
    "marksy": "^8.0.0",
    "optimize-css-assets-webpack-plugin": "^5.0.3",
    "prismjs": "^1.17.1",
    "raw-loader": "^4.0.0",
    "react-addons-create-fragment": "^15.6.2",
    "react-komposer": "^2.0.0",
    "react-test-renderer": "^16.9.0",
    "resolve-url-loader": "^3.1.1",
    "style-loader": "^1.1.3",
    "uglifyjs-webpack-plugin": "^2.2.0",
    "webpack": "4.41.5",
    "webpack-bundle-analyzer": "3.6.0",
    "webpack-cli": "3.3.10",
    "webpack-common-shake": "2.1.0"
  }
}

System:

Environment Info:

  System:
    OS: Windows 10 10.0.17763
    CPU: (4) x64 Intel(R) Core(TM) i5-4300M CPU @ 2.60GHz
  Binaries:
    Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.17763.831.0
@jeffryang24
Copy link

jeffryang24 commented Feb 5, 2020

Hmm... I saw you just call the binary for storybook-start script without npm run.

"storybook-start": "start-storybook -p 9001 -s ./src -c .storybook",

But, why you added npm run inside storybook-build script?

"storybook-build": "npm run build-storybook -c .storybook -o ./dist/my-component/storybook/"

It should be

"storybook-build": "build-storybook -c .storybook -o ./dist/my-component/storybook/"

If you add npm run inside your script, maybe it will execute as npm run npm run build-storybook .... Hahahaha.. Just kidding.... 😆

@Ninita1
Copy link
Author

Ninita1 commented Feb 5, 2020

@jeffryang24 you are right. Thanks. It was bad copy-paste.

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

No branches or pull requests

3 participants