Node.js – node_modules/@types/node/index.d.ts(20,1): error TS1084: Invalid ‘reference’ directive syntax

compilationnode.jstsconfigtypescript

I have a problem with typescript compilation. Have smbd faced with it?

node_modules/@types/node/index.d.ts(20,1): error TS1084: Invalid
'reference' directive syntax.

tsconfig.json:

{
    "compileOnSave": false,
    "compilerOptions": {
        "sourceMap": true,
        "outDir": "./dist",
        "rootDir": "./app",
        "target": "es6",
        "module": "commonjs",
        "declaration": false,
        "noImplicitAny": false,
        "removeComments": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "listFiles": false,
        "skipLibCheck": true
    },
    "include": [
        "./app/**/*.ts"
    ]
}

typescript version in package.json: "typescript": "^2.6.1"

Best Answer

Had the same issue. Open the file ../node_modules/@types/node/index.d.ts

and remove the third slash

// <reference lib="es2015" />

compile again

Related Topic