[英]Module build failed (from ./node_modules/source-map-loader/dist/cjs.js)
I'm trying to make an ecommerce website with React.我正在尝试使用 React 制作一个电子商务网站。 And it was working perfectly but after I install
redux
and react-redux
, I'm getting this error:它工作得很好,但在我安装
redux
和react-redux
,我收到了这个错误:
Uncaught Error: Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open 'D:\ProgrammingHero\foodie\client\node_modules\core-js-pure\modules\esnext.global-this.js'
at ./node_modules/core-js-pure/modules/esnext.global-this.js (global-this.js:6:1)
at options.factory (startup:7:1)
at __webpack_require__ (jsonp chunk loading:133:1)
at fn (jsonp chunk loading:367:1)
at ./node_modules/core-js-pure/full/global-this.js (global-this.js:2:1)
at options.factory (startup:7:1)
at __webpack_require__ (jsonp chunk loading:133:1)
at fn (jsonp chunk loading:367:1)
at ./node_modules/core-js-pure/features/global-this.js (global-this.js:1:1)
at options.factory (startup:7:1)
But if I uninstall redux
and react-redux
it works perfectly.但是,如果我卸载
redux
和react-redux
,它就可以完美运行。
Delete your node_module folder and then run删除你的 node_module 文件夹,然后运行
npm i
It solves the problem for me它为我解决了问题
I was reinstall my package.json without delating node_modules and it worked:我正在重新安装我的 package.json 而没有取消 node_modules 并且它工作:
just write this:写这个:
-> npm i -> npm 我
With the same issue, i just quited from vs code and restarted it, followed with npm start, solved.同样的问题,我只是退出vs代码并重新启动它,然后是npm启动,解决了。
This error message indicates that there was a problem with the source-map-loader module while building your React app.此错误消息表明在构建 React 应用程序时source-map-loader模块出现问题。 The source-map-loader module is used to load and integrate source maps into webpack bundles, and it is typically used in development environments to improve debugging.
source-map-loader模块用于加载源映射并将其集成到 webpack 包中,通常用于开发环境以改进调试。
You are getting this error because the source-map-loader module is not installed: The source-map-loader module is not installed by default in a React app, so you need to install it manually using the npm install source-map-loader
or yarn add source-map-loader command.您收到此错误是因为未安装source -map-loader 模块:默认情况下,source-map-loader 模块未安装在 React 应用程序中,因此您需要使用
npm install source-map-loader
手动安装它或 yarn add source-map-loader 命令。 Once you've installed the module, you should be able to build your app without encountering this error.安装该模块后,您应该能够构建您的应用程序而不会遇到此错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.