2016-07-30 74 views
0

使用的IntelliJ IDEA 2016.2我遇到这个错误打字编译打字稿错误编译Aurelia大街与IntelliJ IDEA的

aurelia_project/generators/binding-behavior.ts(2,52): error TS2307: Cannot find module 'aurelia-cli'. 

奥里利亚CLI产生奥里利亚项目显然是在为node_modules本地和全球性的。鉴于该文件甚至编译的路径?也许它应该被忽略?

如果我理解tsconfig和我的想法设置,这些甚至不应该建成

{ 
    "compileOnSave": false, 
    "compilerOptions": { 
    "sourceMap": true, 
    "target": "es5", 
    "module": "amd", 
    "declaration": false, 
    "noImplicitAny": false, 
    "removeComments": true, 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "moduleResolution": "node", 
    "lib": ["es2015", "dom"] 
    }, 
    "exclude": [ 
    "node_modules" 
    ], 
    "filesGlob": [ 
    "./src/**/*.ts", 
    "./test/**/*.ts", 
    "./typings/index.d.ts", 
    "./custom_typings/**/*.d.ts" 
    ], 
    "atom": { 
    "rewriteTsconfig": false 
    } 
} 

idea settings

au run --watch启动正常

我怎样才能解决这个问题,使思想可以建立该项目没有错误?

回答

0

添加发电机文件夹排除列表 - 该文件夹由Aurelia CLI在内部使用(如果我没有记错的话)。

"exclude": [ 
    "node_modules", 
    "aurelia_project" 
], 
+0

我可以看看它的ups,但由于这是一个SO问题,我是新的打字稿也许你可以提供所需的JSON? – xenoterracide

+0

更新了包含相关排除部分的答案 – xenoterracide

2

在终端中运行编译器时,您将会遇到同样的问题 - Idea(https://youtrack.jetbrains.com/issue/WEB-17991)都不支持filesGlob,这是原子特定的选项。所以所有文件都被编译。而且,由于在项目中找不到“aurelia-cli”的.d.ts文件,因此会报告编译器错误。

来尝试解决问题,你可以改变tsconfig.json以确保只需要文件进行编译,或禁用打字稿编译器和使用奥里利亚构建项目