节点--版本
v10.14.2
npm 版本
6.4.1
一开始没有安装@angular-cli
ng -version
'ng' is not recognized as an internal or external command
我安装了最新版本的角度:
npm install -g @angular/cli
我列出了全局依赖项
npm list -g --depth=0
我明白了
+-- @angular/cli@7.3.5
我检查它的版本
ng --version
我有旧版本 6.2.8 而不是版本 7.3.5。这个旧版本是从哪里来的?我在一个空目录中。
Angular CLI: 6.2.8
Node: 10.14.2
OS: win32 x64
Angular:
当我生成一个新项目时
ng new newapp
在我的 package.json 中,我有旧版本的 @angular-cli 6.2.8 和 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"
}
}
如何生成 @angular-cli 项目版本 7 或 8 ?我做错了什么?