7
votes

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,

3
I only had to install angular-cli locally and it workedChris

3 Answers

1
votes

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.

1
votes

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
0
votes

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.