xenoterracide xenoterracide - 3 months ago 68
TypeScript Question

Typescript error compiling Aurelia with Intellij Idea

Using IntelliJ Idea 2016.2 I'm encountering this error typing to compile an aurelia project generated with

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


aurelia cli is plainly in
node_modules
for both local and global. Given the path should this file even compile? perhaps it should be ignored?

if I understand tsconfig and my idea settings, these shouldn't even be built

{
"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
starts fine

How can I fix this issue so that Idea can build the project without errors?

Answer

Add generators folder to exclude list - that folder is used internally by Aurelia CLI(if i remember correctly).

"exclude": [
  "node_modules",
  "aurelia_project"
],
Comments