0

I have installed typescript using sudo npm install -g typescript, which seems to work because tsc -version returns Version 2.2.2. I also tried installing it locally as this stackoverflow post suggested. I believe that I have everything else installed correctly because the IDE opens other files correctly.

My OS is Ubuntu 16.0.

Error message:

java.lang.IllegalStateException: Node.js could not be found.  If it is installed to a location not on the PATH, please specify the location in the TypeScript preferences.

The tsconfig.json is below. I believe that the value of typeRoots should point to the @types location. And indeed the same directory where the .json file resides, there is a node_modules/@types directory, which I would have thought should enable typescript.

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2016",
      "dom"
    ]
  }
}

1 Answer 1

1

The TypeScript preferences mentioned in the error message are in the Webclipse preferences. Simply enter the path returned by which node in a shell.

Screen shot of configuration

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.