I want to use globally installed webpack, but executing the command webpack --mode development
raises the message:
webpack not installed
Install webpack to start bundling:
$ npm install --save-dev webpack
despite that I have both webpack and webpack-cli installed. Am I right, that webpack says webpack not installed
itself? Isn't it strange?
What to do to successfully build projects globally install webpack and loaders, but using local webpack.config.js?
I was getting a similar error message, and it seems to be related to webpack not being found as a dependency of another package -- which by default won't include a globally installed package. As I understand it, the reason for an npm package to be installed globally is mainly so it can be accessed by the command line, and the general practice is to use local packages in all other situations, and even to install some packages both locally and globally.
Adding my global node_modules directory to my $NODE_PATH
environment variable fixed this error message for me. However, this did not allow a globally installed babel-loader package to work with webpack, and I found it was much easier to just locally install the package I needed.
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