Webpack updates, webpack-cli and git installation – Angular training in Mumbai.

Due to recent webpack changes I suddenly had issues with the new webpack environment. My “npm install webpack -g” was not successful.

But when we try to run “webpack” from command prompt it gave the below error as webpack team has moved things in to “webpack-cli”.

C:\Users\SHIV\Documents\Visual Studio 2017\Projects\WebApplication30\WebApplication30>webpack
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D

So I tried using “npm install webpack-cli -g” and I got some other error 😊. The error stated “git” was not installed.

C:\Users\SHIV\Documents\Visual Studio 2017\Projects\WebApplication30\WebApplication30>npm install webpack-cli -g
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\SHIV\AppData\Roaming\npm-cache\_logs\2018-03-05T09_16_50_359Z-debug.log

So looking at that error I then installed https://gitforwindows.org/ and THEN RESTARTED BY COMMAND CONSOLE and below is the happy image of webpack-cli installation.

1

Finally wasable to run webpack-cli command and the chunks where created like a charm.

2

Please note you also need to install node types by firing “npm install @types/node”.

Happy learning. Learn every day 1 hour and see how you grow. I take Angular training every week Sat and Sunday in Andheri Mumbai sakinaka. If interested you can check out the Angular syllabus from here http://stepbystepschools.net/?page_id=622

Comments

comments

This entry was posted in Angular Mumbai Training, Class Room Training and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.