node.js - 我无法安装本机反应
问题描述
我怎样才能解决这个问题 ?当我在 react native 中安装某些东西时,VC 代码显示该错误,这是一个大问题吗?
pm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2freact-native-simple-alarm - Not found
npm ERR! 404
npm ERR! 404 '@types/react-native-simple-alarm@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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2021-09-21T05_47_59_621Z-debug.log
解决方案
从那个错误看来,您正在安装 Typescript 声明文件。
@types前缀是 Typescript 的专用类型,它是 typescript 声明文件的存储库(您可以在 distinctlyTyped 中阅读更多内容)。
如果您使用 typescript 编译您的 react-native 代码,那么您应该担心,因为如果您使用的库不支持开箱即用的 typescript,您会看到很多编译问题。你可以选择编写一个专门的 d.ts 来支持它,或者如果你很好,你可以为 @types/ 做出贡献,以便其他人可以使用。:)
简单地说,react-native-simple-alarm 似乎在@types 中没有专门的文件,从源代码来看它也不支持自己的打字稿。如果你跑了
npm install @types/react-native-simple-alarm
你会得到异常,因为@types中不存在该库。
如果您只是使用普通的 javascript,那么下面的命令就足够了。
npm install react-native-simple-alarm //or yarn
推荐阅读
- php - 我想从我的 php 表中提取值。我已在表格中嵌入表格,但无法使用 $_POST 获取值
- c - 运行 C 输出时拒绝访问
- javascript - 如何防范编码 URL XSS 攻击
- postgresql - org.postgresql.util.PSQLException:列索引超出范围
- java - 我没有错误,但我的应用程序不断关闭
- python - 使用 Selenium webdriver.Chrome 导致 PermissionError: [WinError 5] Access is denied
- amazon-web-services - PutLifecycleHook 操作:无法将测试消息发布到通知目标 (FIFO)
- java - 递归分而治之
- machine-learning - 加载均匀的预训练 BERT 层进行分类
- amazon-web-services - 如何在站点中将 ec2 实例作为子域运行?