Angular 2最新版本(2.2.10)兼容性问题

时间:2017-04-06 21:03:31

标签: angular

我正在编写一本书的例子。 (如果有人感兴趣the book is this one,任何人都可以下载代码,相关示例位于chapter3 / auction文件夹中。

如果我从下载的代码中运行相同的示例,它可以完美地运行。我正在给我以下错误:

  

错误:(SystemJS)意外的令牌< SyntaxError:意外的令牌<         在eval()         在ZoneDelegate.invoke(http://127.0.0.1:8080/node_modules/zone.js/dist/zone.js:229:26)         在Zone.run(http://127.0.0.1:8080/node_modules/zone.js/dist/zone.js:113:43)         在http://127.0.0.1:8080/node_modules/zone.js/dist/zone.js:509:57         在ZoneDelegate.invokeTask(http://127.0.0.1:8080/node_modules/zone.js/dist/zone.js:262:35)     评估http://127.0.0.1:8080/node_modules/@angular/router/bundles     加载http://127.0.0.1:8080/app/main.ts时出错         在eval()         在ZoneDelegate.invoke(http://127.0.0.1:8080/node_modules/zone.js/dist/zone.js:229:26)         在Zone.run(http://127.0.0.1:8080/node_modules/zone.js/dist/zone.js:113:43)         在http://127.0.0.1:8080/node_modules/zone.js/dist/zone.js:509:57         在ZoneDelegate.invokeTask(http://127.0.0.1:8080/node_modules/zone.js/dist/zone.js:262:35)     评估http://127.0.0.1:8080/node_modules/@angular/router/bundles     加载http://127.0.0.1:8080/app/main.ts

时出错

经过多次悲痛并比较两个项目后,唯一的区别是所使用的库的版本,所以我认为问题是不同依赖项之间存在某种不兼容性。

这是本书的package.json依赖项:

  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",

    "core-js": "^2.4.0",
    "rxjs": "5.0.0-beta.12",
    "systemjs": "0.19.37",
    "zone.js": "0.6.21",

    "bootstrap": "^3.3.6",
    "jquery": "^2.2.2"
    },
  "devDependencies": {
    "live-server": "0.8.2",
    "typescript": "^2.0.0"
  }

这是我的:

"dependencies": {
    "@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",
    "core-js": "2.4.1",
    "rxjs": "5.3.0",
   "systemjs": "0.19.47",
    "zone.js": "0.7.2",
    "bootstrap": "^3.3.7",
    "jquery": "^3.2.1"
  },
  "devDependencies": {
    "live-server": "^0.8.2",
    "typescript": "^2.0.0"
  }

到目前为止,我唯一能够收集的是Angular与Zone,SystemJS和/或rxjs之间的关系不佳。我尝试使用旧版本的Zone和rxjs,但后来我收到警告,Angular 2.4.10需要我正在使用的版本。

有没有人见过这种行为?
如果是这样,有什么办法可以解决它吗? 如果唯一的解决方案是降级,哪个版本?

谢谢。

0 个答案:

没有答案
相关问题