Theres no other way since you are using the command line editor to run webpack command when installing with a -g option. Problem with this approach is you'd have to maintain links for each project you have. edited the command link webpack.cmd and pointed the webpack.js to look into my local node_modules folder within my application.installed webpack locally within project edited the command link webpack.cmd and pointed the webpack.js to look into my local nodemodules folder within my application Problem with this approach is youd have to maintain links for each project you have.renamed the webpack folder in global node_modules to _old.To make this work locally, I did the following Outside the global node_modules a link is created for webpack to be run from commandline Same with webpack-cli and webpack-dev-server Installing webpack with -g option installs webpack in a folder inĬ:\Users\\AppData\Roaming\npm\node_modules
When I try to run this from my project's root directroy it does not do anything at all (See Screenshot) However, this command does not seem to be working or doing anything at all. This installed Webpack and now I do have a Webpack command.
One solution to this problem was to install webpack globally on my machine which I did using the command below : npm install -g webpack
The problem with this is that I have to place my file inside of this directory which I want to place in my project root. The 1st command installed webpack locally into the project under the 'node-modules' directory and I can run my project by doing this: nodejs node-modules/webpack/bin/webpack.js I used the command prompt to cd into this directory and then ran the following command npm init and then installed webpack via npm using the command below : npm install -S webpack I tried to start a project with module-loaders.įirstly, I installed nodeJs and NPM and created a new directory called tutorial.