node can not find webpack module on windows 10

10,049

When you install a module globally npm install -g webpack (as is required by webpack), it actually becomes available on your command line. So you just need to run:

webpack ./app.js bundle.js

As for the error which you were getting when running:

node webpack ./app.js bundle.js

that's because when you run node webpack you're actually (supposedly) passing the file webpack.js (or webpack/index.js) to node, hence the "Cannot find module" error.

Share:
10,049
srgg6701
Author by

srgg6701

Web-developer

Updated on June 15, 2022

Comments