vipin
vipin

Reputation: 367

ERROR in multi main, Module not found: Error: Can't resolve 'webpack-dev-server/client?http://localhost:4200/' in 'node_modules\angular-cli\ models'

I Am new in Angular2 Cli, Here I found an errors while running my Cli project.

ERROR in multi main, Module not found: Error: Can't resolve 'webpack-dev-server/client?http://localhost:4200/' in 'node_modules\angular-cli\ models'

I have installed 'webpack' and 'webpack-dev-server' globally, but still the error remain.

Any body, please help me to find a solution.

Thanks,

Upvotes: 7

Views: 6435

Answers (4)

Arsen Khachaturyan
Arsen Khachaturyan

Reputation: 8330

In my case, it was failing not only for webpack-dev-server but also couldn't find the application module and app.component.sccs (some info about that here).

I've tried a lot of options, like the official Angular setup guide and ofc the above solutions.

It turned out the issue was a damn simple which ordinary can happen when developing for Windows, which was that the application path was too long. By moving the project to the drive root folder, all problems were gone.

Upvotes: 0

vaquar khan
vaquar khan

Reputation: 11449

Upgrade your node

https://nodejs.org/en/

Install

npm cache clean

npm update -g

npm install -g ember-cli

Then delete your old project and run commands again

npm install -g angular-cli

ng new my-new-app

cd my-new-app

ng serve

Upvotes: 1

Ricardo Duarte
Ricardo Duarte

Reputation: 88

I am having the same error.

node 6.9.0, npm 3.10.8

EDIT:

Solved my problem via this issue.

The solution was to install angular-cli locally.

Upvotes: 0

Wassim Chegham
Wassim Chegham

Reputation: 558

You don't need to install webpack nor webpack-dev-server globally. They come installed by CLI.

I had the same issue today. And I discovered that I was using an old shell session that was using Node v4. After upgrading to a newer version of Node (v6). I had no more issue.

Upvotes: 1

Related Questions