I'm learning React and installed webpack through npm to my project directory but zsh is not finding the command even though I can see webpack installed in my project. I used npm init --yes
followed by npm install --save webpack
There is no need to install webpack globally.
Try my way:
First, in your package.json file, add this:
"scripts": { "start": "webpack" },
Then, in your terminal, run
$npm start
Another quick way: Just run (Yes, it is 'npx')
$npx webpack
That's all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With