Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack command not found

I have installed webpack using

npm install -g webpack

and

npm install webpack  

I also installed webpack-dev-server

npm install -g webpack-dev-server 

After completion of installation, I ran the command webpack but, it shows below error

webpack: command not found

I am not getting what is the error.

like image 883
Bishnu Bhattarai Avatar asked Jun 30 '17 11:06

Bishnu Bhattarai


People also ask

How do I run a webpack command?

Scaffold a plugin. Run the webpack-dev-server . Output the version number of webpack , webpack-cli and webpack-dev-server . Run webpack and watch for files changes.

Can not find webpack?

To solve the "Cannot find module 'webpack'" error, make sure to install webpack globally by running the npm i -g webpack command and create a symbolic link from the globally-installed package to node_modules by running the npm link webpack command. Copied! Once you run the two commands, the error should be resolved.

How do I run a webpack locally?

To run the local installation of webpack you can access its binary version as node_modules/. bin/webpack . Alternatively, if you are using npm v5. 2.0 or greater, you can run npx webpack to do it.

How do you fix webpack is not recognized as an internal or external command?

Use npx to solve the error "webpack is not recognized as an internal or external command, operable program or batch file", e.g. npx webpack or install the package locally by running npm install --save-dev webpack webpack-cli to use the command in your package. json file.


1 Answers

Your webpack exists in ./node_modules/.bin/ folder . So you should execute this command :

./node_modules/.bin/webpack 

Check out the answer in this thread .

webpack command not working

like image 153
Natesh bhat Avatar answered Sep 16 '22 20:09

Natesh bhat