Encountering difficulties while trying to compile an older typescript project that I am revisiting. The build process is failing due to an issue with q. I suspect it may be related to the tsc version, but no matter which version I try, errors persist.
Some online suggestions advised reverting to a TypeScript version prior to 2.2 because of differences in typings handling, but this has not yielded any progress.
I have included error details, versions, and my tsconfig.json file. Please reach out if more information is needed.
Errors ($tsc -v 2.1.5)
$ tsc -p ./
typings/modules/q/index.d.ts(10,1): error TS1316: Global module exports may only appear at top level.
Versions
nvm: 1.1.5
npm: 4.1.2
tsc: 2.1.5
node: 7.5.0
$ npm list --depth=0
+-- @types/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="28596819061d0619">[email protected]</a>
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c8bcb1b8adbbabbaa1b8bc88fae6f9e6fd">[email protected]</a>
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "amd",
"outDir": "static/js",
"sourceMap": true,
"strictNullChecks": true,
"noImplicitAny": true
},
"files": [
"typings/index.d.ts",
"../common/types.d.ts"
],
"include": [
"src/**/*.ts"
]
}
EDIT
The errors reported under tsc v2.3.0 were actually from the 2.1.5 version. Since I did not install TypeScript globally, the command was still using 2.1.5 instead of 2.3.0.