[英]Can't resolve 'fs' , 'os','path','querystring' in in 'C:\Users\..\node_modules\ibm-cloud-sdk-core\lib' in React Js application
I want to make a React Application which uses IBM's Watson AI like Text to speech conversion.我想制作一个使用 IBM 的 Watson AI 的 React 应用程序,例如文本到语音的转换。 For that I have generated TTS service on IBM Cloud.
为此,我在 IBM Cloud 上生成了 TTS 服务。 added Credentials and keys in the code.
在代码中添加了凭据和密钥。 but when I run the application via npm start or yarn start, it gives me errors like below:
但是当我通过 npm start 或 yarn start 运行应用程序时,它会给我如下错误:
Module not found: Error: Can't resolve 'fs' in 'C:..\node_modules\ibm-cloud-sdk-core\lib'找不到模块:错误:无法解析“C:..\node_modules\ibm-cloud-sdk-core\lib”中的“fs”
Module not found: Error: Can't resolve 'os' in 'C:..\node_modules\ibm-cloud-sdk-core\auth\utils'找不到模块:错误:无法解析“C:..\node_modules\ibm-cloud-sdk-core\auth\utils”中的“os”
Module not found: Error: Can't resolve 'http' in 'C:..\node_modules\ibm-cloud-sdk-core\auth\utils'找不到模块:错误:无法解析“C:..\node_modules\ibm-cloud-sdk-core\auth\utils”中的“http”
Can anyone help me with above errors.谁能帮我解决上述错误。 It seems error from node_modules.
似乎来自 node_modules 的错误。
Is it with some version related issues?是否与某些版本相关的问题? Any SDKs,Packages need to installed to run the application?
是否需要安装任何 SDK、软件包才能运行该应用程序?
Request you to help me with solutions and suggestion to resolved the above errors.请求您帮助我解决上述错误的解决方案和建议。
Thanks.谢谢。
This error indeed seems to deal with missing node modules that you try to import.这个错误似乎确实与您尝试导入的丢失节点模块有关。 Try to run this command in order to install all dependencies that you miss:
尝试运行此命令以安装您错过的所有依赖项:
npm install -g npm-install-missing
npm-install-missing
Alternatively, you may try to install all dependencies listed in your package.json
this way:或者,您可以尝试以这种方式安装
package.json
中列出的所有依赖项:
npm install
If you need to install some specific dependency and you know its name, this solution will install it and add to your package.json
:如果您需要安装某些特定的依赖项并且您知道它的名称,此解决方案将安装它并将其添加到您的
package.json
中:
npm install {package-name} --save
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.