首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >模块从Webpack v1升级到v3后未发现错误

模块从Webpack v1升级到v3后未发现错误
EN

Stack Overflow用户
提问于 2022-06-30 21:24:31
回答 1查看 76关注 0票数 0

我正在尝试从Webpack v1升级到v3 --我一直在跟踪官方迁移文档中的所有内容,但是在运行node client/scripts/start.js时,我仍然会遇到这些错误。我不知道如何修复它们:

代码语言:javascript
复制
  Starting dev server on port 3000...

  Failed to compile.

  Error in ./node_modules/react-dev-utils/webpackHotDevClient.js
  Module not found: Can't resolve 'ansi-html' in '/Users/me/work/-admin/node_modules/react-dev-utils'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js
  Module not found: Can't resolve 'babel' in '/Users/me/work/-admin'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in ./client/config/polyfills.js
  Module not found: Can't resolve 'bluebird' in '/Users/me/work/-admin/client/config'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in ./client/config/polyfills.js
  Module not found: Can't resolve 'core-js/actual' in '/Users/me/work/-admin/client/config'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in ./node_modules/react-dev-utils/webpackHotDevClient.js
  Module not found: Can't resolve 'html-entities' in '/Users/me/work/-admin/node_modules/react-dev-utils'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in ./client/config/polyfills.js
  Module not found: Can't resolve 'object-assign' in '/Users/me/work/-admin/client/config'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js
  Module not found: Can't resolve 'react-hot-loader/patch' in '/Users/me/work/-admin'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in ./client/config/polyfills.js
  Module not found: Can't resolve 'regenerator-runtime/runtime' in '/Users/me/work/-admin/client/config'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in ./node_modules/react-dev-utils/webpackHotDevClient.js
  Module not found: Can't resolve 'sockjs-client' in '/Users/me/work/-admin/node_modules/react-dev-utils'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in ./node_modules/react-dev-utils/webpackHotDevClient.js
  Module not found: Can't resolve 'strip-ansi' in '/Users/me/work/-admin/node_modules/react-dev-utils'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

  Error in ./client/config/polyfills.js
  Module not found: Can't resolve 'whatwg-fetch' in '/Users/me/work/-admin/client/config'

  @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./client/config/polyfills.js react-hot-loader/patch ./client/src/index.js

不过,我有这么多人。这些文件确实存在。

有人有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2022-06-30 21:33:35

您缺少依赖项或它们的坏版本

如果是节点模块中的错误,这意味着您的版本与webpack版本不兼容。这里说的是react-dev-utils和webpack玩得不好

代码语言:javascript
复制
Error in ./node_modules/react-dev-utils/webpackHotDevClient.js

如果错误在项目中的一个文件中,那么您将丢失依赖项并需要安装它。

代码语言:javascript
复制
Error in ./client/config/polyfills.js
  Module not found: Can't resolve 'whatwg-fetch'

安装它

代码语言:javascript
复制
npm i --save whatwg-fetch
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72822193

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档