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

项目启动时报错:Cannot find module 'webpack-bundle-analyzer' #9177

Closed
C1erman opened this issue Apr 24, 2021 · 2 comments
Closed

项目启动时报错:Cannot find module 'webpack-bundle-analyzer' #9177

C1erman opened this issue Apr 24, 2021 · 2 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@C1erman
Copy link

C1erman commented Apr 24, 2021

相关平台

微信小程序

小程序基础库: 2.14.0
使用框架: React

复现步骤

yarn
yarn dev:weapp

期望结果

项目正常运行

实际结果

报错:(node:9140) UnhandledPromiseRejectionWarning: Error: Cannot find module 'webpack-bundle-analyzer'

环境信息

👽 Taro v3.0.13


  Taro CLI 3.0.13 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.16.1 - F:\environment\node\node.EXE
      Yarn: 1.22.10 - C:\Users\C1ER\AppData\Roaming\npm\yarn.CMD
      npm: 6.14.12 - F:\environment\node\npm.CMD


补充信息

项目内taro版本:
"@tarojs/components": "3.0.13",
"@tarojs/react": "3.0.13",
"@tarojs/runtime": "3.0.13",
"@tarojs/taro": "3.0.13",
Taro cli版本:
PS C:\Users\C1ER> taro --version
👽 Taro v3.0.13

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Apr 24, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 25, 2021

@C1erman 没有复现。

  1. 确认你的 'webpack-bundle-analyzer' 依赖安装成功
  2. 确认webpackChain 配置是否正确:https://docs.taro.zone/docs/2.x/migrate-to-2#%E5%8F%91%E8%A7%89%E5%8D%87%E7%BA%A7%E4%B9%8B%E5%90%8E%E6%96%87%E4%BB%B6%E6%9B%B4%E5%A4%A7
  3. Taro 升级到最新版本

@Chen-jj Chen-jj closed this as completed Apr 25, 2021
@C1erman
Copy link
Author

C1erman commented Apr 25, 2021

确实是因为 webpack-bundle-analyzer 依赖未安装导致的,谢谢解惑。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants