通过JSPM安装Angular组件路由器会导致神秘的404错误

时间:2016-03-27 18:31:24

标签: angular typescript npm systemjs jspm

我有一个JSPM/Typescript/Angular 1.5.3项目。我想使用the new component router。在我的项目目录中,我使用了命令

jspm install npm:@angular/router

安装正常,没有错误。然后我使用

将其添加到我的app.ts文件中
import ngComponentRouter from 'jspm_packages/npm/@angular/router@0.2.0/angular1/angular_1_router'

但是当我开始lite-server时,我得到了

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://localhost:3000/jspm_packages/npm/@angular/instruction.json

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://localhost:3000/jspm_packages/npm/@angular/utils.json

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://localhost:3000/jspm_packages/npm/@angular/url_parser.json

我不确定为什么要加载这些神秘的JSON文件,所以我检查了我的package.json:

{
  "jspm": {
    "name": "app",
    "dependencies": {
      "": "npm:@angular/router@^0.2.0",
      "angular": "npm:angular@^1.5.3", 

嗯......空""看起来不对劲。如果JSPM无法解析包名并且路由器要求JSON文件,我觉得缺少构建步骤。我在这里做错了什么?

0 个答案:

没有答案