我一直试图弄清楚发生了什么,但没有成功。我尝试重新安装,更新babel,更改脚本(我在搜索解决方案中找到的各种内容),但似乎没有任何效果。
我遵循了故事书指南,开始运行:
npx -p @storybook/cli sb init
然后yarn storybook
并出现此错误:
./.storybook/generated-stories-entry.js] 1.41 KiB {main} [built] [failed] [1 error]
[./.storybook/preview.js-generated-config-entry.js] 1.41 KiB {main} [built] [failed] [1 error]
[./.storybook/storybook-init-framework-entry.js] 1.41 KiB {main} [built] [failed] [1 error]
[./node_modules/@storybook/addon-actions/dist/preset/addArgs.js] 2.41 KiB {vendors~main} [built]
[./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js] 2.24 KiB {vendors~main} [built]
[./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js] 216 bytes {vendors~main} [built]
[./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-other-entry.js] 2.25 KiB {vendors~main} [built]
[./node_modules/@storybook/addon-backgrounds/dist/preset/defaultParameters.js-generated-other-entry.js] 2.26 KiB {vendors~main} [built]
[./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js] 2.25 KiB {vendors~main} [built]
[./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js-generated-other-entry.js] 2.25 KiB {vendors~main} [built]
[./node_modules/@storybook/addon-links/dist/preset/addDecorator.js-generated-other-entry.js] 2.25 KiB {vendors~main} [built]
[./node_modules/@storybook/core/dist/server/common/polyfills.js] 120 bytes {vendors~main} [built]
[./node_modules/@storybook/core/dist/server/preview/globals.js] 93 bytes {vendors~main} [built]
[./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined] 7.68 KiB {vendors~main} [built]
+ 411 hidden modules
ERROR in ./.storybook/storybook-init-framework-entry.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\min-indent\index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:316:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:705:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:969:27)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\strip-indent\index.js:2:19)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\react-docgen\dist\utils\printValue.js:10:43)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js-generated-other-entry.js ./node_modules/@storybook/addon-links/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/preset/defaultParameters.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js ./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined main[2]
ERROR in ./.storybook/generated-stories-entry.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\min-indent\index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:316:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:705:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:969:27)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\strip-indent\index.js:2:19)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\react-docgen\dist\utils\printValue.js:10:43)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js-generated-other-entry.js ./node_modules/@storybook/addon-links/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/preset/defaultParameters.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js ./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined main[10]
ERROR in ./.storybook/preview.js-generated-config-entry.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\min-indent\index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:316:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:705:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:969:27)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\strip-indent\index.js:2:19)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\react-docgen\dist\utils\printValue.js:10:43)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
@ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js-generated-other-entry.js ./node_modules/@storybook/addon-links/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/preset/defaultParameters.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js ./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined main[9]
Child HtmlWebpackCompiler:
Asset Size Chunks Chunk Names
__child-HtmlWebpackPlugin_0 6.48 KiB HtmlWebpackPlugin_0 HtmlWebpackPlugin_0
Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
[./node_modules/@storybook/core/node_modules/html-webpack-plugin/lib/loader.js!./node_modules/@storybook/core/dist/server/templates/index.ejs] 2.13 KiB {HtmlWebpackPlugin_0} [built]
WARN Broken build, fix the error above.
WARN You may need to refresh the browser.
答案 0 :(得分:0)
错误日志指出,无论出于何种原因,您的 iterate()
文件夹中都可能缺少您的 IntStream
软件包。
错误:找不到模块“C:\Users\Avner\Desktop\NewLib\ewlib\node_modules\min-indent\index.js”。请验证 package.json 是否具有有效的“main”条目
我对 storybook github 问题进行了快速搜索,这个错误似乎至少可以通过 3 种方式解决:
Input list: 2 -> 3 -> 5 -> 7 -> 11 -> 13 -> 17 -> 19
Output list: 3 -> 7 -> 13 -> 19
来自 github 的示例解决方案:
def list_recursive(head):
if head is None:
return None
if head.next is None:
return None
else:
head.next = head.next.next
list_recursive(head.next)
return head
依赖项列表中。特定包可能是您的 2 -> 5 -> 11 -> 17
中声明的另一个包的依赖项。在这种情况下,它不需要列出,您可以尝试第 3 步。
来自 github 的示例解决方案:
min-indent
文件夹和 node_modules
文件,然后完全重新安装您的本地软件包。// w/ npm
npm i min-indent
// w/ yarn
yarn add min-indent
来自 github 的示例解决方案:
package.json
,而是尝试不同的卸载/安装顺序。值得一试。看起来他们的 github issues 中有几个示例,其中版本更新可能会导致某些软件包中断。如果上述解决方案不起作用,请尝试在他们的 github 上提交问题。看起来故事书团队反应迅速,将帮助您开始工作!