Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zsh: command not found: webpack

Tags:

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

like image 934
akantoword Avatar asked Mar 11 '16 04:03

akantoword


1 Answers

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.

like image 151
J.Du Avatar answered Sep 18 '22 00:09

J.Du