@ angular / router未正确安装

时间:2016-06-22 20:06:23

标签: node.js angular npm angular-routing

我正在尝试将@ angular /路由器依赖关系从2.0.0升级到3.0.0-alpha.7

我已将其添加到package.json

{
  "name": "angular2-quickstart",
  "version": "1.0.0",
  "scripts": {
    "start": "tsc && concurrently \"npm run tsc:w\"",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0-rc.2",
    "@angular/compiler": "2.0.0-rc.2",
    "@angular/core": "2.0.0-rc.2",
    "@angular/http": "2.0.0-rc.2",
    "@angular/platform-browser": "2.0.0-rc.2",
    "@angular/platform-browser-dynamic": "2.0.0-rc.2",
    "@angular/router": "^3.0.0-alpha.7",
    ........
  },

}

当我使用“npm install”安装路由器但未创建“bundles”文件夹时。 enter image description here

因此,当我尝试运行我的项目时,我收到此错误:

GET http://localhost:5000/node_modules/@angular/router/bundles/router.umd.js 404 (Not Found)

Someboy知道会发生什么事吗?

由于 伊万。

2 个答案:

答案 0 :(得分:1)

已在alpha-8版本中解决。

感谢您的回答。

答案 1 :(得分:0)

确保您拥有最新的systemjs.config.js文件。在RC2发布后(以及在RC3发布之前)几天后添加以下块 -

  function packUmd(pkgName) {
    packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
  }