1

I have small project that is perfectly compiling on my home machine, but I'm getting hundreds of errors on another PC. The only difference between environment I can notice is that PC that I have troubles on is under windows 8 (PC's on windows 10 and ubuntu works fine with it).

Global npm list (depth=0):

+-- [email protected]
+-- [email protected]
`-- [email protected]

tsc version = 1.0.3.0

tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "noImplicitAny": false
    },
    "exclude": [
        "node_modules"
    ]
}

The problems starts with /// <reference path="node_modules/@types/jquery/index.d.ts" />

That is how my output looks like: errors

6
  • On the Windows machine, what is the output of this command: where tsc Commented Jan 17, 2017 at 7:54
  • @cartant C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.exe C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\tsc.js C:\Users\Aliaksei.Kaupayeu\AppData\Roaming\npm\tsc C:\Users\Aliaksei.Kaupayeu\AppData\Roaming\npm\tsc.cmd Commented Jan 17, 2017 at 7:57
  • 1
    That first one is an ancient version of tsc. You will need to examine your PATH and remove C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0 from it. And then close and re-open any command prompts, etc. Commented Jan 17, 2017 at 7:59
  • That is my PATH variable C:\Users\Aliaksei.Kaupayeu\AppData\Roaming\npm;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files\Git\cmd Commented Jan 17, 2017 at 8:02
  • What about the system PATH? It must be in there somewhere. Commented Jan 17, 2017 at 8:03

1 Answer 1

2

Some old versions of Visual Studio install an early version of the TypeScript SDK in the following location:

%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.0

Unfortunately, that SDK directory is added to the system PATH and causes problems if it precedes the %USERPROFILE%\Roaming\npm directory, as an old version of tsc will be run instead of the NPM-installed version.

To determine whether or not this is the problem, run the following command to see the location of tsc:

where tsc

If it's in the SDK's directory, you will need to remove that directory from the system PATH (see this answer for Windows 10 instructions) and then close and re-open any command prompts.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.