首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复-找不到模块'@okta/okta-react‘的声明文件-错误?

如何修复-找不到模块'@okta/okta-react‘的声明文件-错误?
EN

Stack Overflow用户
提问于 2020-09-14 15:32:40
回答 2查看 3.5K关注 0票数 1

我在我的应用程序中安装了@okta/okta-react包,但它引发了以下错误?

代码语言:javascript
复制
Could not find a declaration file for module '@okta/okta-react'.
'.../node_modules/@okta/okta-react/dist/index.js' implicitly has an 'any' type.
Try `npm install @types/okta__okta-react` if it exists or add a new declaration (.d.ts)
file containing `declare module '@okta/okta-react';`ts(7016)

如何修复此错误?

我试过什么?

我查过这个博客。我试图实现这个解决方案,但我的应用程序没有tsconfig.json。

编辑1:

我试图安装@types/okta__okta-react,但得到了以下错误:

代码语言:javascript
复制
$ npm install @types/okta__okta-react
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2fokta__okta-react - Not found
npm ERR! 404 
npm ERR! 404  '@types/okta__okta-react@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-09-14 15:42:06

似乎他们还没有类型。您需要在这里遵循devs的建议,https://github.com/okta/okta-oidc-js/issues/66#issuecomment-394574326

票数 3
EN

Stack Overflow用户

发布于 2021-07-06 10:11:23

更改节点版本

在我的例子中,没有找到模块:无法解决错误,它在更改节点版本后得到了解决。以前版本= v12.4.0更新为= v15.8.0

尝试nvm使用15.8.0 (在终端)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63887425

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档