Rodrigo Ramos Xochiteotzin
PreguntaHola, buenas
Una duda: estaba instalando webpack en un proyecto y todo bien pero cuando corrí
npx webpack
me salió esto:
1 warning has detailed information that is not shown. Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it. ERROR in ./node_modules/body-parser/lib/read.js 18:11-26 Module not found: Error: Can't resolve 'zlib' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/body-parser/lib' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "zlib": require.resolve("browserify-zlib") }' - install 'browserify-zlib' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "zlib": false } @ ./node_modules/body-parser/lib/types/json.js 19:11-29 @ ./node_modules/body-parser/index.js 142:15-42 @ ./node_modules/express/lib/express.js 15:17-39 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/body-parser/lib/types/urlencoded.js 228:12-34 Module not found: Error: Can't resolve 'querystring' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/body-parser/lib/types' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }' - install 'querystring-es3' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "querystring": false } @ ./node_modules/body-parser/index.js 151:15-48 @ ./node_modules/express/lib/express.js 15:17-39 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/content-disposition/index.js 22:15-39 Module not found: Error: Can't resolve 'path' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/content-disposition' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } @ ./node_modules/express/lib/response.js 16:25-55 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/cookie-signature/index.js 5:13-30 Module not found: Error: Can't resolve 'crypto' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/cookie-signature' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }' - install 'crypto-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "crypto": false } @ ./node_modules/express/lib/response.js 26:11-43 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/destroy/index.js 14:17-41 Module not found: Error: Can't resolve 'fs' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/destroy' @ ./node_modules/send/index.js 18:14-32 @ ./node_modules/express/lib/response.js 31:11-26 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/destroy/index.js 15:13-30 Module not found: Error: Can't resolve 'stream' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/destroy' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }' - install 'stream-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "stream": false } @ ./node_modules/send/index.js 18:14-32 @ ./node_modules/express/lib/response.js 31:11-26 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/etag/index.js 21:13-30 Module not found: Error: Can't resolve 'crypto' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/etag' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }' - install 'crypto-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "crypto": false } @ ./node_modules/express/lib/utils.js 21:11-26 @ ./node_modules/express/lib/application.js 24:18-48 25:25-62 26:19-50 @ ./node_modules/express/lib/express.js 18:12-36 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/etag/index.js 22:12-31 Module not found: Error: Can't resolve 'fs' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/etag' @ ./node_modules/express/lib/utils.js 21:11-26 @ ./node_modules/express/lib/application.js 24:18-48 25:25-62 26:19-50 @ ./node_modules/express/lib/express.js 18:12-36 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/express/lib/application.js 23:11-26 Module not found: Error: Can't resolve 'http' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/express/lib' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }' - install 'stream-http' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "http": false } @ ./node_modules/express/lib/express.js 18:12-36 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/express/lib/application.js 30:14-37 Module not found: Error: Can't resolve 'path' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/express/lib' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } @ ./node_modules/express/lib/express.js 18:12-36 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/express/lib/request.js 18:11-30 Module not found: Error: Can't resolve 'net' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/express/lib' @ ./node_modules/express/lib/express.js 21:10-30 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/express/lib/request.js 20:11-26 Module not found: Error: Can't resolve 'http' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/express/lib' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }' - install 'stream-http' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "http": false } @ ./node_modules/express/lib/express.js 21:10-30 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/express/lib/response.js 20:11-26 Module not found: Error: Can't resolve 'http' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/express/lib' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }' - install 'stream-http' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "http": false } @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/express/lib/response.js 23:11-26 Module not found: Error: Can't resolve 'path' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/express/lib' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/express/lib/utils.js 24:18-40 Module not found: Error: Can't resolve 'querystring' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/express/lib' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }' - install 'querystring-es3' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "querystring": false } @ ./node_modules/express/lib/application.js 24:18-48 25:25-62 26:19-50 @ ./node_modules/express/lib/express.js 18:12-36 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/express/lib/view.js 17:11-26 Module not found: Error: Can't resolve 'path' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/express/lib' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } @ ./node_modules/express/lib/application.js 22:11-28 @ ./node_modules/express/lib/express.js 18:12-36 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/express/lib/view.js 18:9-22 Module not found: Error: Can't resolve 'fs' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/express/lib' @ ./node_modules/express/lib/application.js 22:11-28 @ ./node_modules/express/lib/express.js 18:12-36 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/mime-types/index.js 16:14-37 Module not found: Error: Can't resolve 'path' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/mime-types' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } @ ./node_modules/type-is/index.js 16:11-32 @ ./node_modules/express/lib/request.js 19:13-31 @ ./node_modules/express/lib/express.js 21:10-30 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/mime/mime.js 1:11-26 Module not found: Error: Can't resolve 'path' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/mime' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } @ ./node_modules/send/index.js 24:11-26 @ ./node_modules/express/lib/response.js 31:11-26 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/mime/mime.js 2:9-22 Module not found: Error: Can't resolve 'fs' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/mime' @ ./node_modules/send/index.js 24:11-26 @ ./node_modules/express/lib/response.js 31:11-26 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/parseurl/index.js 15:10-24 Module not found: Error: Can't resolve 'url' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/parseurl' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "url": require.resolve("url/") }' - install 'url' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "url": false } @ ./node_modules/express/lib/request.js 23:12-31 @ ./node_modules/express/lib/express.js 21:10-30 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/send/index.js 23:9-22 Module not found: Error: Can't resolve 'fs' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/send' @ ./node_modules/express/lib/response.js 31:11-26 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/send/index.js 28:11-26 Module not found: Error: Can't resolve 'path' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/send' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } @ ./node_modules/express/lib/response.js 31:11-26 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/send/index.js 30:13-30 Module not found: Error: Can't resolve 'stream' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/send' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }' - install 'stream-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "stream": false } @ ./node_modules/express/lib/response.js 31:11-26 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/send/index.js 31:11-26 Module not found: Error: Can't resolve 'util' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/send' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "util": require.resolve("util/") }' - install 'util' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "util": false } @ ./node_modules/express/lib/response.js 31:11-26 @ ./node_modules/express/lib/express.js 22:10-31 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/serve-static/index.js 19:14-37 Module not found: Error: Can't resolve 'path' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/serve-static' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } @ ./node_modules/express/lib/express.js 81:0-40 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./node_modules/serve-static/index.js 21:10-24 Module not found: Error: Can't resolve 'url' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/node_modules/serve-static' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "url": require.resolve("url/") }' - install 'url' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "url": false } @ ./node_modules/express/lib/express.js 81:0-40 @ ./node_modules/express/index.js 11:0-41 @ ./src/index.js 6:16-34 ERROR in ./src/index.js 10:13-28 Module not found: Error: Can't resolve 'path' in '/home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista/src' BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }' - install 'path-browserify' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "path": false } 28 errors have detailed information that is not shown. Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it. webpack 5.44.0 compiled with 28 errors and 1 warning in 4773 ms npm ERR! code 1 npm ERR! path /home/dgrm/Documentos/codigo/apps/maquetaDentista/maquetaDentista npm ERR! command failed npm ERR! command sh -c webpack "--mode" "production" npm ERR! A complete log of this run can be found in: npm ERR! /home/dgrm/.npm/_logs/2021-07-15T06_22_23_393Z-debug.log
¿Alguna idea? :c
Antonio Luis Gil Rodríguez
Hola!
Puede que esto te ayude: https://stackoverflow.com/questions/64557638/how-to-polyfill-node-core-modules-in-webpack-5
Saludos!
Elias Rayas Gonzalez
No se si esto sea el caso, pero instalaste el resto de las dependencias? Usa npm install antes de correr webpack.
![Curso de Webpack [Empieza Gratis]](https://static.platzi.com/media/courses/OpengraphWebpack_1.png)