-1

I have latest version on node (v25.0.0) and npm (11.4.2) but still unable to download.

I used below command

npm i --save -D webpack

It gave me up to date, audited 18 packages in 6s found 0 vulnerabilities

but when I am doing

npm ls webpack

microfrontend-fundamentals@ E:\micro-frontends\microfrontend-fundamentals -- (empty)

Also when I run npm start

It is giving below error

PS D:\git\micro-frontends\microfrontend-fundamentals\host> npx webpack
[webpack-cli] Failed to load 'D:\git\micro-frontends\microfrontend-fundamentals\host\webpack.config.js' config
[webpack-cli] Error: Cannot find module 'html-webpack-plugin'
Require stack:
- D:\git\micro-frontends\microfrontend-fundamentals\host\webpack.config.js
- C:\Users\AppData\Roaming\npm\node_modules\webpack-cli\lib\webpack-cli.js
- C:\Users\AppData\Roaming\npm\node_modules\webpack-cli\lib\bootstrap.js
- C:\Users\AppData\Roaming\npm\node_modules\webpack-cli\bin\cli.js
- C:\Users\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1419:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
    at Module._load (node:internal/modules/cjs/loader:1225:37)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1502:12)
    at require (node:internal/modules/helpers:152:16)
    at Object.<anonymous> (D:\git\micro-frontends\microfrontend-fundamentals\host\webpack.config.js:4:27)
    at Module._compile (node:internal/modules/cjs/loader:1759:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'D:\\git\\micro-frontends\\microfrontend-fundamentals\\host\\webpack.config.js',
    'C:\\Users\\AppData\\Roaming\\npm\\node_modules\\webpack-cli\\lib\\webpack-cli.js',
    'C:\\Users\\AppData\\Roaming\\npm\\node_modules\\webpack-cli\\lib\\bootstrap.js',
    'C:\\Users\\AppData\\Roaming\\npm\\node_modules\\webpack-cli\\bin\\cli.js',
    'C:\\Users\\AppData\\Roaming\\npm\\node_modules\\webpack\\bin\\webpack.js'
  ]
}

Please suggest what to do?

3
  • I don't know why this is trying to use your global webpack installation. AFAIK, it shouldn't. But also, you probably shouldn't have a global webpack installation anyway. Commented 2 days ago
  • Also, that npm start is executing npx webpack in a different directory, in microfrontend-fundamentals\hostt not in microfrontend-fundamentals. The setup here seems a bit more convoluted than a couple of commands seem to suggest. Commented 2 days ago
  • If I simple install webpack in fresh folder, still its not getting installed giving same --empty error :( Commented 2 days ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.