Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.5K
Visualizações
node_modules/@types/node/index.d.ts(20,1): error TS1084: Invalid 'reference' directive syntax

I have a problem with typescript compilation. Has anybody else received this error?

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"

over 4 years ago · Santiago Trujillo
9 Respostas
Responde à pergunta

0

Try downgrading the @type/node.

I had the same issue with

"devDependencies": {
    "@types/node": "12.20.42",
}

I downgraded it to lower version and it compiles successfully

"devDependencies": {
    "@types/node": "12.19.12",
}
over 4 years ago · Santiago Trujillo Relatório

0

update TypeScript

npm install typescript@latest --save-dev
over 4 years ago · Santiago Trujillo Relatório

0

Had the same error and the fix was to use the previous version, check the version that you have in package.json for @types/node and see if you have the latest or not. You can check here: https://www.npmjs.com/package/@types/node as it seams that there was a new update.

over 4 years ago · Santiago Trujillo Relatório

0

I got the same error. I used the pinned version "@types/node": "7.0.7" in my package.json and got it working.

over 4 years ago · Santiago Trujillo Relatório

0

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

and remove the third slash

// <reference lib="es2015" />

compile again

over 4 years ago · Santiago Trujillo Relatório

0

I have faced the same problem and found the solution is to update typescript to the latest version from the current version.

Make changes in the package.json file like below:

"devDependencies": {
     "typescript": "^3.9.7"
 }

Now npm install typescript, it will upgrade to the latest version. Then run "ng serve" and it will compile successfully.

over 4 years ago · Santiago Trujillo Relatório

0

My solution is to change typescript version to '>=2.7.3'. I think the version might depend on other packages. probably need to try a couple of times to get the right version. And don't forget to run install.

over 4 years ago · Santiago Trujillo Relatório

0

I have faced the same problem and found the solution is to update typescript to the latest version from the current version.

Make changes in the package.json file like below:

"devDependencies": {
     "typescript": "^3.9.7"
 }

Now "npm install typescript" , it will upgrade to latest version. Then run "ng serve" and it will compile successfully.

over 4 years ago · Santiago Trujillo Relatório

0

Its worked for me ckeckout your tags for versions of TypeScript. run npm dist-tag ls @types/node and look for your currently typescript version.

Then install the @types/node version supporting for typescript in my case I had to install 14.0.1 version

reference: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/47250#issuecomment-687701880

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda