i have the error then start typescript compile
my package.json file
{
"name": "functions",
"scripts": {
"build": "tsc",
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "8"
},
"main": "lib/index.js",
"dependencies": {
"@google-cloud/datastore": "^4.3.0",
"firebase-admin": "^8.0.0",
"firebase-functions": "^3.1.0",
"googleapis": "^43.0.0",
"nconf": "^0.10.0",
"querystring": "^0.2.0"
},
"devDependencies": {
"@types/nconf": "^0.10.0",
"typescript": "^3.2.2"
},
"private": true
}
> tsc
node_modules/@grpc/grpc-js/build/src/call-stream.d.ts:92:5 - error TS2416: Property '_write' in type 'Http2CallStream' is not assignable to the same property in base type 'Duplex'.
Type '(chunk: WriteObject, encoding: string, cb: WriteCallback) => void' is not assignable to type '(chunk: any, encoding: string, callback: (err?: Error | undefined) => void) => void'.
Types of parameters 'cb' and 'callback' are incompatible.
Types of parameters 'err' and 'error' are incompatible.
Type 'Error | null | undefined' is not assignable to type 'Error | undefined'.
Type 'null' is not assignable to type 'Error | undefined'.
92 _write(chunk: WriteObject, encoding: string, cb: WriteCallback): void;
~~~~~~
node_modules/@grpc/grpc-js/build/src/call-stream.d.ts:92:5 - error TS2416: Property '_write' in type 'Http2CallStream' is not assignable to the same property in base type '{ cancelWithStatus(status: Status, details: string): void; getPeer(): string; sendMetadata(metadata: Metadata): void; getDeadline(): number | Date; getCredentials(): CallCredentials; setCredentials(credentials: CallCredentials): void; getStatus(): StatusObject | null; getMethod(): string; getHost(): string; } & ... ...'.
Type '(chunk: WriteObject, encoding: string, cb: WriteCallback) => void' is not assignable to type '((chunk: WriteObject, encoding: string, callback: Function) => void) & ((chunk: any, encoding: string, callback: (err?: Error | undefined) => void) => void) & ((chunk: WriteObject, encoding: string, callback: Function) => void)'.
Type '(chunk: WriteObject, encoding: string, cb: WriteCallback) => void' is not assignable to type '(chunk: any, encoding: string, callback: (err?: Error | undefined) => void) => void'.
92 _write(chunk: WriteObject, encoding: string, cb: WriteCallback): void;
~~~~~~
Can you share the output of npm ls?
I was having the same issue, and I installed the latest types for node (even though I did not even had it installed at the first place) and it started to work again. I read somewhere that this issue is connected to the installed node typings...
npm install --save-dev @types/node@latest
@agyimr thank you! Much appreciated.
Most helpful comment
I was having the same issue, and I installed the latest types for node (even though I did not even had it installed at the first place) and it started to work again. I read somewhere that this issue is connected to the installed node typings...
npm install --save-dev @types/node@latest