Thought to share one of the errors which I usually face, whenever I switch machine. Scenario is I am working on any greenfield project which is basically an angular 4 project with asp.net core. I have a habit of keeping my code on source control which is git in this case. However, when I clone the same on different machine and install my usual dependencies with npm install; soon after that when I run my app, it gives me below error.
Therefore, the reason is very obvious. If I look at my solution explorer and look at wwwroot folder, you will see there is no dist folder here.
Therefore, we need to run webpack to create our bundles. First we need to create our vendor bundle with the below command.
webpack –config webpack.config.vendor.js
This will give following confirmation in your command prompt.
Once this is done. Then, we need to create our main bundle with command webpack as shown below.
With the above changes in place, if I look at my solution explorer, then I can see that dist folder has been restored in my wwwroot folder.
Now, When I go ahead and run my app, it will run fine.
I hope you would have liked today’s discussion. Thanks for Joining me.
6,481 total views, 1 views today