npm - NPM 安装/Babel 或 Gatsby 问题后 Storybook 失败?
问题描述
我一直在成功运行 storybook,但最近 npm 安装了 jest,这导致我的整个 package.json 更新并且 storybook 坏了。不知道从哪里开始(babel 或 gatsby 的问题?),但是当我尝试运行故事书时,这是我的终端的错误:
> > ERROR in ./node_modules/gatsby/cache-dir/navigation.js > Module not found: Error: Can't resolve './redirects.json' in '/Users/zmason/Documents/code/resourcehub-components/node_modules/gatsby/cache-dir' > @ ./node_modules/gatsby/cache-dir/navigation.js 12:17-44 > @ ./node_modules/gatsby/cache-dir/page-renderer.js > @ ./node_modules/gatsby/cache-dir/public-page-renderer-prod.js > @ ./node_modules/gatsby/cache-dir/public-page-renderer.js > @ ./node_modules/gatsby/cache-dir/gatsby-browser-entry.js > @ ./src/components/Card/LinkCard.js > @ ./stories/index.stories.js > @ ./.storybook/config.js > @ multi ./node_modules/@storybook/react/dist/server/config/polyfills.js > ./node_modules/@storybook/react/dist/server/config/globals.js > (webpack)-hot-middleware/client.js?reload=true ./.storybook/config.js > Child html-webpack-plugin for "iframe.html": > Asset Size Chunks Chunk Names > iframe.html 569 kB 0 > [0] ./node_modules/html-webpack-plugin/lib/loader.js!./node_modules/@storybook/react/dist/server/iframe.html.ejs > 1.16 kB {0} [built] > [1] ./node_modules/lodash/lodash.js 540 kB {0} [built] > [2] (webpack)/buildin/global.js 509 bytes {0} [built] > [3] (webpack)/buildin/module.js 517 bytes {0} [built] > Child html-webpack-plugin for "index.html": > Asset Size Chunks Chunk Names > index.html 569 kB 0 > [0] ./node_modules/html-webpack-plugin/lib/loader.js!./node_modules/@storybook/react/dist/server/index.html.ejs > 1.7 kB {0} [built] > [1] ./node_modules/lodash/lodash.js 540 kB {0} [built] > [2] (webpack)/buildin/global.js 509 bytes {0} [built] > [3] (webpack)/buildin/module.js 517 bytes {0} [built] > >
任何帮助都会很大!
解决方案
推荐阅读
- javascript - 为什么我的 React Native 组件不存在 this.props.onLayout?
- android - 显示附近的标记
- angular - 使用Angular自动清除ShadowDOM中元素的输入?
- android - 我需要 TextToSpeech 在后台工作,我该怎么做?
- django - 尝试在 django 中发送电子邮件时出现超时错误
- google-cloud-dataflow - 在 DoFn 中下载文件
- vb.net - Radio.SetStateAsync(RadioState) 方法不适用于 MobileBroadband RadioKind (VB+Windows10)
- json - 如何从无服务器火炮中的随机 JSON 索引中捕获属性
- python - 如何将结果仅写入测试套件 selenium 中的一个文件
- r - 安装 R 包“ld:警告:找不到选项的目录”时出现问题