简体   繁体   English

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

[英]Module not found errors after upgrading from Webpack v1 to v3

I'm trying to upgrade from Webpack v1 to v3 I've followed everything in the official migration docs, but I keep getting these errors when running node client/scripts/start.js .我正在尝试从 Webpack v1 升级到 v3 我已经遵循了官方迁移文档中的所有内容,但是在运行node client/scripts/start.js时我不断收到这些错误。 I have no idea how to fix them:我不知道如何解决它们:

  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

I have all these deps though.不过,我有所有这些部门。 The files definitely exist.这些文件肯定存在。

Anybody have any ideas?有人有什么想法吗?

You're missing the dependencies or have bad versions of them您缺少依赖项或它们的版本不正确

If it's an error in your node module, that means you have a version that is incompatible with your webpack version.如果这是您的节点模块中的错误,则意味着您的版本与您的 webpack 版本不兼容。 Here it is saying that react-dev-utils is not playing nice with webpack这里是说react-dev-utils与 webpack 不兼容

Error in ./node_modules/react-dev-utils/webpackHotDevClient.js

If the error is in a file in your project, then you are missing the dependency and need to install it如果错误出现在项目中的文件中,那么您缺少依赖项并需要安装它

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

Install it安装它

npm i --save whatwg-fetch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM