Why type definition errors preventing me from deploying cloud function?

Viewed 14

I have tried to update my cloud function the way that I always used to do, but for some reason it's not working.

I get this error:

error TS2688: Cannot find type definition file for 'jsonwebtoken 2'.


Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the functions@ build script.

I thought that I could fix it by simply installing type for it:

npm install @types/jsonwebtoken 2 --save-dev

But then I get another error:

npm WARN idealTree Removing dependencies.@types/jsonwebtoken in favor of devDependencies.@types/jsonwebtoken
npm WARN idealTree Removing dependencies.2 in favor of devDependencies.2
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: undefined,
npm WARN EBADENGINE   required: { node: '16' },
npm WARN EBADENGINE   current: { node: 'v17.5.0', npm: '8.4.1' }
npm WARN EBADENGINE }
  1. Firstly why do type definition errors prevent me from deploying code? It has nothing to do with the actual code, I want to be allowed to push the code anyways.

  2. If it's impossible to push the code with this error being present, how do I fix it?

0 Answers
Related