Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module 'D:\nodejs\node_modules\webpack\bin\webpack.js'

When I run 'webpack' in cmd, it gives me an error:

Cannot find module 'D:\nodejs\node_modules\webpack\bin\webpack.js

But I get correct result when I run it in Git Bash.

I have set the NODE_PATH and install webpack global

CMD Image

Git Bash Image

like image 904
dogLin Avatar asked Apr 05 '17 11:04

dogLin


People also ask

Can not find module webpack JS?

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.

Where I can find webpack config JS?

To answer your specific question, the webpack configuration is stored wherever your global node_modules are installed; on Windows this is typically %AppData%\Roaming\npm\node_modules\powerbi-visuals-tools\lib\webpack. config. js.

Does webpack work with node?

Webpack provides a Node. js API which can be used directly in Node. js runtime.


1 Answers

Try this in your CMD

npm remove webpack -g
npm i webpack --save-dev
npm run webpack
like image 79
DragonBorn Avatar answered Sep 22 '22 10:09

DragonBorn