2

node --version

v10.14.2

npm version

6.4.1

At first, @angular-cli is not installed

ng -version

'ng' is not recognized as an internal or external command

I install the latest version of angular with:

npm install -g @angular/cli

I list global dependencies

npm list -g --depth=0

I get

+-- @angular/cli@7.3.5

I check its version

ng --version

I have instead of version 7.3.5 the old version 6.2.8. Where is this old version coming from? I'm in an empty directory.

Angular CLI: 6.2.8 Node: 10.14.2 OS: win32 x64 Angular:

When I generate a new project with

ng new newapp

in my package.json I have the old version of @angular-cli 6.2.8 and angular 6.1.0

{ "name": "newapp", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^6.1.0", "@angular/common": "^6.1.0", "@angular/compiler": "^6.1.0", "@angular/core": "^6.1.0", "@angular/forms": "^6.1.0", "@angular/http": "^6.1.0", "@angular/platform-browser": "^6.1.0", "@angular/platform-browser-dynamic": "^6.1.0", "@angular/router": "^6.1.0", "core-js": "^2.5.4", "rxjs": "~6.2.0", "zone.js": "~0.8.26" }, "devDependencies": { "@angular-devkit/build-angular": "~0.8.0", "@angular/cli": "~6.2.8", "@angular/compiler-cli": "^6.1.0", "@angular/language-service": "^6.1.0", "@types/jasmine": "~2.8.8", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "codelyzer": "~4.3.0", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~3.0.0", "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", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.11.0", "typescript": "~2.9.2" } } How can I generate an @angular-cli project version 7 or 8 ? what I'm doing wrong ?

Anusha_Mamidala
  • 397
  • 2
  • 11
ovione
  • 31
  • 1
  • 5

2 Answers2

0

thanks for the quick answer but I got the same problem. Here are the steps I followed:

npm uninstall -g @angular/cli
npm cache verify
npm list --depth -g
   empty 
ng -v
   'ng' is not recognized as an internal or external command,
npm install -g @angular/cli@latest
npm list --depth -g
    +-- @angular/cli@7.3.5
ng -v
    Angular CLI: 6.2.8

So its listed as 7.3.5 but when I do ng -v I have version 6.2.8 Before I had version 6.2.8. That means that there must be maybe a remaining version 6.2.8 somwhere. But by the steps explained at the start it doesn't seem so.

ovione
  • 31
  • 1
  • 5
-1

I would suggest do follow the below commands now and check

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
arpit sharma
  • 405
  • 4
  • 11