无法使用angular-cli创建Angular 5项目

时间:2017-12-10 13:00:36

标签: angularjs linux angular-cli npm-install angular5

即使重新安装后也无法使用angular-cli 1.6

sudo npm install -g @angular/cli --unsafe-perm

/usr/bin/ng -> /usr/lib/node_modules/@angular/cli/bin/ng npm WARN @schematics/angular@0.1.10 requires a peer of @angular-devkit/schematics@0.0.40 but none is installed. You must install peer dependencies yourself. npm WARN @schematics/schematics@0.0.10 requires a peer of @angular-devkit/schematics@0.0.40 but none is installed. You must install peer dependencies yourself.

+@angular/cli@1.6.0

updated 1 package in 22.197s

ng仍显示旧版

$ ng -v

angular-cli: 1.0.0-beta.28.3

node: 8.9.2

os: linux x64

@angular/common: 2.4.10

@angular/compiler: 2.4.10

@angular/core: 2.4.10

@angular/forms: 2.4.10

@angular/http: 2.4.10

@angular/platform-browser: 2.4.10

@angular/platform-browser-dynamic: 2.4.10

@angular/router: 3.4.10

@angular/compiler-cli: 2.4.10

1 个答案:

答案 0 :(得分:1)

看起来您已经安装了angular cli globaly的旧版本。 尝试使用以下命令卸载它:

sudo npm uninstall -g angular-cli 
npm cache clean

这里是关于github anglur-cli的更新故事的link