I have downloaded the latest typescript compiler , but i am getting error when when i tries to build my Server.ts file.
i am getting error from node.d.ts
Error TS1110 Build: Type expected.
My tsd.json file look like the following
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"express/express.d.ts": {
"commit": "4bd9b47f0ea79ba83c2e831c56bcaf8ba3a2c8ad"
},
"serve-static/serve-static.d.ts": {
"commit": "4bd9b47f0ea79ba83c2e831c56bcaf8ba3a2c8ad"
},
"mime/mime.d.ts": {
"commit": "4bd9b47f0ea79ba83c2e831c56bcaf8ba3a2c8ad"
},
"express-serve-static-core/express-serve-static-core.d.ts": {
"commit": "4bd9b47f0ea79ba83c2e831c56bcaf8ba3a2c8ad"
},
"node/node.d.ts": {
"commit": "4bd9b47f0ea79ba83c2e831c56bcaf8ba3a2c8ad"
}
}
}
replace "repo": "borisyankov/DefinitelyTyped", to "repo": "DefinitelyTyped/DefinitelyTyped", first.
Hi,
I did the same but the error is the same.
And one more point to add is that i am building my application in Visual Studio code , and the
"repo": "borisyankov/DefinitelyTyped" is create by VS code itself.
Please help.
Still no answer for me ! Please help.
I had a similar problem, due to my typescript installation being out of date.
Can you check what tsc version you have installed?
Running tsc --version in a terminal window should show you the version
I have the same thing, it has to be user error somehow but I'm not sure what.
My tsc version is
Version 1.0.3.0
still getting the same error
now i find one work around,
my app.ts file code is
///
module AngularJsDemo.Scripts{
var app = angular.module('app',[]);
app.filter('LimitToChar',function () {
return function (InputValue:string,MaxCharCount:number) {
return (InputValue.length>MaxCharCount)?InputValue.substring(0,MaxCharCount):InputValue;
}
});
app.controller('TestController',function () {
var InputValue:string;
});
}
when i tries to generate the .js file it give me errors and all the errors are from the main.d.ts file that i reference in the 1st line. Now if i remove that reference the app.ts file of mine compile to generate the app.js file with one warning that angular is not define.
At least i got my js file.
@cdebdeep Your tsc version is outdated, thus causing the compile errors.
Simply remove the current typescript version and reinstall it with
npm install typescript -g
Following this, tsc -version should ouptut something like Version 1.8.10 and your code will compile
Let me know if this solves your problem
I fixed the issue. I had to update my settings.json in vscode to point to the latest version of typescript. Just because I had the latest typescript installed didn't mean it was being used by default.
I had the same issue, and installing the latest typescript as a separate npm package, and then configuring grunt-ts to use the custom tsc version fixed it for me.
Uninstall the current version of Typescript with:
npm uninstall typescript --save
Then reinstall i with:
npm install typescript --save-dev