I just added "@google-cloud/logging-winston":"2.1.0", in my pacakge.json and when I compile I get the following errors. I have seen this with other google libraries occasionally, and its root cause is most likely deeper in the stack in automatic generated types from protobuf definitions.
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1434:32 - error TS2304: Cannot find name 'Long'.
1434 line?: (number|Long|null);
~~~~
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1453:38 - error TS2304: Cannot find name 'Long'.
1453 public line: (number|Long);
~~~~
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1543:39 - error TS2304: Cannot find name 'Long'.
1543 requestSize?: (number|Long|null);
~~~~
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1549:40 - error TS2304: Cannot find name 'Long'.
1549 responseSize?: (number|Long|null);
~~~~
../node_modules/@google-cloud/logging/build/proto/logging.d.ts:1576:42 - error TS2304: Cannot find name 'Long'.
1576 cacheFillBytes?: (number|Long|null);
Here is how I worked around this issue until it is taken care of.
"long":"4.0.0","@types/long":"4.0.0",{
"compilerOptions": {
...
"types": [
...
"long"
],
...
}
gae123 suggestion did not work for me on typescript version 4.9.4. I added the following to tsconfig.json. Hope this helps.
"compilerOptions":{
...
"skipLibCheck": true,
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With