首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >React & Clarifai:未定义的ReferenceError:流程

React & Clarifai:未定义的ReferenceError:流程
EN

Stack Overflow用户
提问于 2022-02-22 23:14:41
回答 2查看 3K关注 0票数 0

我正在使用Clarifai的脸检测模型构建一个React应用程序。当我import Clarifai from "clarifai"时,VS代码提示我发出以下警告:

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

我尝试了建议的解决方案,但只得到了错误:

代码语言:javascript
复制
npm i --save-dev @types/clarifai
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@types%2fclarifai - Not found
npm ERR! 404
npm ERR! 404  '@types/clarifai@*' is not in this 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时,我得到一个空白屏幕,检查控制台,并给出以下错误:

代码语言:javascript
复制
Uncaught ReferenceError: process is not defined
    _init App.js:124
    App App.js:53
    js App.js:14
    factory react refresh:6

前两个返回到安装在node_modules文件夹中的clarifai文件夹。第三个是我的“导入Clarifai”代码。

API客户端的安装方式是否有问题,或者我的客户端出了什么问题?

谢谢你的帮助!

EN

回答 2

Stack Overflow用户

发布于 2022-02-23 08:02:49

这里发生了很多事情:

上使用google。

如果能帮上忙就告诉我。

票数 1
EN

Stack Overflow用户

发布于 2022-07-18 07:40:40

//在src文件夹中创建一个新文件,并在其中放置以下代码块

申报模块"clarifai";

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

https://stackoverflow.com/questions/71229471

复制
相关文章

相似问题

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