Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 219 Vote(s) - 3.55 Average
  • 1
  • 2
  • 3
  • 4
  • 5
node_modules/@types/node/index.d.ts(20,1): error TS1084: Invalid 'reference' directive syntax

#1
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"`
Reply

#2
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:

[To see links please register here]

as it seams that there was a new update.
Reply

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

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

and remove the third slash

// <reference lib="es2015" />

compile again
Reply

#5
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.
Reply

#6
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.
Reply

#7
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.
Reply

#8
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][1]


reference:

[To see links please register here]



[1]:
Reply

#9
**update TypeScript**

npm install typescript@latest --save-dev
Reply

#10
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",
}
```
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through