ng的问题服务于Angular 2

时间:2017-11-13 10:46:49

标签: javascript angular npm npm-install

我在安装现有的角度应用程序时遇到问题。

我正在尝试使用ng serve命令启动应用程序,并且发生此错误: The "@angular/compiler-cli" package was not properly installed. Error: reflect-metadata shim is required when using class decorators

我已经使用package.json命令安装了npm install文件中提供的所有软件包,我知道它们有点过时,但它们仍然可以工作。

这些都是开发依赖项:

"card"                             : "^1.2",
"del"                              : "latest",
"gulp"                             : "latest",
"gulp-autoprefixer"                : "latest",
"gulp-concat"                      : "latest",
"gulp-cssnano"                     : "2.x",
"gulp-eslint"                      : "latest",
"gulp-html5-lint"                  : "latest",
"gulp-htmlmin"                     : "2.x",
"gulp-imagemin"                    : "latest",
"gulp-inline-source"               : "latest",
"gulp-notify"                      : "latest",
"gulp-plumber"                     : "latest",
"gulp-rev-all"                     : "latest",
"gulp-sass"                        : "latest",
"gulp-scss-lint"                   : "latest",
"gulp-sourcemaps"                  : "2.0.0-alpha",
"gulp-svg-sprite"                  : "latest",
"gulp-tslint"                      : "4.x",
"gulp-typescript"                  : "2.x",
"gulp-uglify"                      : "latest",
"gulp-util"                        : "latest",
"merge-stream"                     : "latest",
"tslint"                           : "3.x",
"browser-sync"                     : "2.x",
"connect-history-api-fallback"     : "latest",
"typescript"                       : "1.x",
"typings"                          : "^0.8.1",
"svg4everybody"                    : "2.x",
"jquery"                           : "2.x",
"jasmine"                          : "2.x",
"semantic-ui"                      : "2.x",
"@angular/common"                  : "2.0.0-rc.1",
"@angular/compiler"                : "2.0.0-rc.1",
"@angular/compiler-cli"            : "^2.0.x",
"@angular/core"                    : "2.0.0-rc.1",
"@angular/http"                    : "2.0.0-rc.1",
"@angular/platform-browser"        : "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router"                  : "2.0.0-rc.1",
"@angular/router-deprecated"       : "2.0.0-rc.1",
"@angular/upgrade"                 : "2.0.0-rc.1",
"@angular/cli"                     : "1.4.8",
"systemjs"                         : "0.19.27",
"es6-shim"                         : "^0.35.0",
"reflect-metadata"                 : "^0.1.3",
"rxjs"                             : "5.0.0-beta.6",
"zone.js"                          : "^0.6.12",
"angular2-in-memory-web-api"       : "0.0.7"

任何人都知道如何解决这个问题?我正在努力解决这个问题,因为我对Angular很新,任何建议都被接受了。

提前致谢。

2 个答案:

答案 0 :(得分:0)

对于enable angular cli命令,必须通过此命令将其安装在节点的全局区域

npm install -g angular-cli

答案 1 :(得分:0)

我解决了这个npm install -g angular-cli@1.0.0-beta.28.3(全局安装该版本的cli)