Error: TSError: ⨯ Unable to compile TypeScript
See original GitHub issueHey guys, I am facing the problem:
My Project is built on Angular4 with typescript
Node v6.10.3
npm v3.10.10
Travis-CI has this error:
run ng e2e,
log:
[03:34:54] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript
Cannot find type definition file for 'jasmine'. (2688)
Cannot find type definition file for 'node'. (2688)
e2e/app.e2e-spec.ts (1,32): Cannot find module './app.po'. (2307)
e2e/app.e2e-spec.ts (4,1): Cannot find name 'describe'. (2304)
e2e/app.e2e-spec.ts (7,3): Cannot find name 'beforeEach'. (2304)
e2e/app.e2e-spec.ts (11,3): Cannot find name 'it'. (2304)
e2e/app.e2e-spec.ts (13,5): Cannot find name 'expect'. (2304)
The command "ng e2e" exited with 4.
My tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": ".",
"paths": {
"*": ["./node_modules/*", "*"]
},
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"types": [ "node", "jasmine" ],
"typeRoots": [
"./node_modules/@types"
],
"lib": [
"es2016",
"dom"
]
}
}
Any idea about the problem?
Issue Analytics
- State:
- Created 6 years ago
- Comments:12
Top Results From Across the Web
Error: TSError: ⨯ Unable to compile TypeScript - Stack Overflow
I had met same issue. First I remove ts-node and typescript from package.json . then, npm install ts-node --save-dev npm install typescript ......
Read more >TSError: ⨯ Unable to compile TypeScript after version `10.1.0 ...
After upgrading from version 10.0.3 to 10.1.0 cypress shows this error. The typescript file seems to be ignored, the project works fine with...
Read more >I got Unable to compile TypeScript error - CircleCI Discuss
[test:execute] TSError: ⨯ Unable to compile TypeScript: [test:execute] src/step_definitions/DEMO_RESTAPI.steps.ts(5,24): error TS2307: Cannot ...
Read more >Compiling TypeScript into JavaScript | IntelliJ IDEA ... - JetBrains
IntelliJ IDEA comes with a built-in TypeScript compiler. By default, it outputs generated JavaScript files and sourcemaps next to the TypeScript file.
Read more >Unhandled rejection TSError: Unable to compile TypeScript
Problem statement: - DevTools listening on ws://127.0.0.1:52555/devtools/browser/24e3b3aa-b5fe-4940-bfb8-b1c18e4c60df Unhandled rejection ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Mine is not a new project, I am running an angular2 project with
"@angular/cli": "1.2.0". I updated my typescript version from2.0.3to2.7.2and now I am getting similar issues while runningng e2e. I have updated all the@types/*to latest versions, also updatedjasmine-corebut still have the same issue. Does anyone know any other solution to this?I fixed it by updating
ts-nodeto5.0.1. Versions above this were giving errors like the one below while runningng e2e:Apart from the above change, I also changed few lines in
protractor.conf.jsChanged:
beforeLaunch: function () { require('ts-node').register({ project: 'e2e' }); },to
beforeLaunch: function () { require('ts-node/register') }@Ks89 I downgraded “
@types/jasmine”:“=2.5.38”But it is not work, Travis-ci also has this error
here is my package.json: