4thSpace
4thSpace

Reputation: 44312

Why doesn't Angular CLI project start?

I have an Angular 4 project that I created a couple of months ago. When I go into the Angular project folder and type in ng serve, I get this error:

You have to be inside an angular-cli project in order to use the serve command.

Any idea what is wrong?

Is there some specific file that I can verify is there?

As a side note, I create a ng new Folder2 and was able to successfully run ng serve in that folder.

Upvotes: 1

Views: 2839

Answers (1)

angularconsulting.au
angularconsulting.au

Reputation: 28279

For me it is seems like as you didn't touch the project for so long you might have an older version of the angular cli in you project than your global version or way around.

if you run ng -v outside your project it show you global cli version
if you run ng -v inside your project it will show you local cli version, also you can check the cli version in package.json in devDependencies

So you have two options.
1 update angular cli
2 run npm run ng serve this way npm will run the local angular cli, the one form package.json file

Upvotes: 4

Related Questions