尝试安装npm install express-openid-connect
时遇到错误。库似乎无法找到openid-client
。我试图通过安装类型,创建一个单独的d.ts
文件与declare module 'openid-client';
,降级express-openid-connect
和openid-client
库来解决这个问题,但没有成功。每次我都会收到不同的错误。有人能帮助解决这个问题吗?
下面是完整的stacktrace:
> npm run build
node_modules/express-openid-connect/index.d.ts:9:8 - error TS7016: Could not find a declaration file for module 'openid-client'. '/myproject/functions/node_modules/openid-client/lib/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/openid-client` if it exists or add a new declaration (.d.ts) file containing `declare module 'openid-client';`
9 } from 'openid-client';
~~~~~~~~~~~~~~~
node_modules/express-openid-connect/index.d.ts:11:15 - error TS2724: '"jose"' has no exported member named 'JSONWebKey'. Did you mean 'JSONWebKeySet'?
11 import type { JSONWebKey, KeyInput } from 'jose';
~~~~~~~~~~
node_modules/express-openid-connect/index.d.ts:11:27 - error TS2305: Module '"jose"' has no exported member 'KeyInput'.
11 import type { JSONWebKey, KeyInput } from 'jose';
~~~~~~~~
Found 3 errors in the same file, starting at: node_modules/express-openid-connect/index.d.ts:9
1条答案
按热度按时间lsmd5eda1#
在尝试了很多不同的事情之后。我最终只是试图玩版本,出于某种原因,在某些时候我决定添加更具体的
openid-client
版本,它的工作!以下配置使其发生:我希望这对其他人有帮助,因为它非常烦人