Felipe Flores
Felipe Flores

Reputation: 170

angular - ANY port is already in use. Use '--port' to specify a different port

When I will running with ng s or ng serve, any port is in use

I haven't project runing, I can put any port, the problem happen.

if I try another project in angular, works

for information the version

$ ng -version

Your global Angular CLI version (8.2.0) is greater than your local
version (6.2.9). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

Angular CLI: 6.2.9
Node: 10.16.3
OS: linux x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Upvotes: 0

Views: 1883

Answers (3)

Felipe Flores
Felipe Flores

Reputation: 170

I switch 6 to 7 and, works

    "devDependencies": {
    "@angular-devkit/build-angular": "~0.11.0",
    "@angular/cli": "~7.1.4",
    "@angular/compiler-cli": "~7.1.0",
    "@angular/language-service": "~7.1.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.1.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "node-sass": "^4.11.0",
    "protractor": "~5.4.0",
    "replace-in-file": "^4.1.1",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.1.6"
  }

Upvotes: 1

Evaldas Buinauskas
Evaldas Buinauskas

Reputation: 14097

Angular by default will serve application on port 4200. If this port is already in use (by Angular or by any other application), you need to specify a port on your own.

For instance:

ng serve --port 4201

This will serve application on port 4201 and you'll be able to open it.

Upvotes: 1

Muhammed Albarmavi
Muhammed Albarmavi

Reputation: 24462

the default port is 4200 if you run two project of angular one of them must run in different port or maybe another process use this port 🤔

try this ng s --port 3000 later your access to the project like this localhost:3000

this message

Your global Angular CLI version (8.2.0) is greater than your local version (6.2.9). The local Angular CLI version is used.

mean your project has been created by angular cli version 6.2.9 and local version of the cli is included in the node_module in case of the global angular cli has different version the local one will be use to run , generate ,build ... so your project will not break in case of the latest version of angular and keep running

Upvotes: 0

Related Questions