使用JSPM进行Angular2设置

时间:2016-06-10 21:08:51

标签: typescript angular jspm

我尝试使用jspm设置基本的“hello-world”应用程序,一切正常,直到我尝试安装reflect-metadata包(我通过从安装字符串中排除包来识别)

jspm install angular2 reflect-metadata zone.js es6-shim

此命令给出了下一个错误:TypeError: toMap.startsWith is not a function

jspm.config.js

System.config({
  baseURL: "/lessons/angular2/test/",
  defaultJSExtensions: true,
  transpiler: "typescript",
  typescriptOptions: {
    "tsconfig": "tsconfig.json"
  },
  paths: {
    "github:*": "jspm_packages/github/*",
    "npm:*": "jspm_packages/npm/*"
  },

  packages: {
    "app": {
      "defaultExtension": "ts"
    }
  }

  ...maps goes here    
});

的package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "jspm": {
    "configFile": "jspm.config.js",
    "dependencies": {
      "angular2": "npm:angular2@^2.0.0-beta.17",
      "es6-shim": "github:es-shims/es6-shim@^0.35.1",
      "zone.js": "npm:zone.js@^0.6.12"
    },
    "devDependencies": {
      "typescript": "npm:typescript@^1.6.2"
    }
  },
  "dependencies": {
    "typescript": "^1.8.10"
  }
}

tsconfig.js

{
  "compilerOptions": {
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "noImplicitAny": false,
    "module": "system",
    "moduleResolution": "node",
    "target": "es5",
    "sourceMap": false
  },
  "exclude": [
    "jspm_packages",
    "node_modules"
  ],
  "compileOnSave": false
}

有什么想法吗?

P.S。谷歌搜索不给任何东西。

0 个答案:

没有答案