在组件时
moduleId: module.id
时,报Cannot find name 'module'
?解决方法:
You need to install node ambientDependencies. Typings.json
"ambientDependencies": { "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#138ad74b9e8e6c08af7633964962835add4c91e2" }
Another way can use typings manager to install node definition file globally:
typings install dt~node --global --save
Then your typings.json file will look like this:
"globalDependencies": { "node": "registry:dt/node#6.0.0+20160608110640" }
If you use Typescript 2^ just use the following command:
npm install @types/node --global --save
Or install it within the project:
npm install @types/node --save
and then add a reference to it from your bootstrap:
///<reference path="../../node_modules/@types/node/index.d.ts" />
而后出现
Url.match is not a function
?解决方法:
报错:
Property 'find' does not exist on type 'Hero[]'.
?解决方法:在
typings.json
中配置如下代码{ "globalDependencies": { "core-js": "registry:dt/core-js#0.0.0+20160725163759", "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", "node": "registry:dt/node#6.0.0+20160909174046" } }