SystemJS加载器无法在libs / @ types / lodash中找到@ types / lodash

时间:2016-11-12 08:30:58

标签: typescript lodash

我正在努力让lodash上班并遇到this。我遵循了此处提供的指南,但仍然在下面收到错误。

Error: (SystemJS) XHR error (404) loading https://localhost:44382/libs/@types/lodash(…)(anonymous function) @ (index):34ZoneDelegate.invoke @ zone.js:232Zone.run @ zone.js:114(anonymous function) @ zone.js:502ZoneDelegate.invokeTask @ zone.js:265Zone.runTask @ zone.js:154drainMicroTaskQueue @ zone.js:401ZoneTask.invoke @ zone.js:339

这是我的tsconfig文件

{
"compileOnSave": true,
"compilerOptions": {
"typeRoots": [
  "libs/@types/"
],
"types": ["lodash"],
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"watch": true,
"module": "commonjs",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "../wwwroot/appScripts/",
"removeComments": false,
"sourceMap": true,
"target": "es6",
"moduleResolution": "node"
},
 "exclude": [
"node_modules",
"typings/index",
"typings/index.d.ts",
"typings/browser",
"typings/browser.d.ts"
]
}

enter image description here

1 个答案:

答案 0 :(得分:0)

事实证明我使用的打字稿版本与lodash不兼容。 我从typescript 2.0.8切换回2.0.3,一切都到位了。我使用的lodash版本是4.16.6,@ types / lodash版本是4.14.38