简体   繁体   English

无法在 React Js 应用程序中解析 'C:\Users\..\node_modules\ibm-cloud-sdk-core\lib' 中的 'fs'、'os'、'path'、'querystring'

[英]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.

相关问题 找不到模块:无法在“C:\Users\name\ecom\node_modules\react-dom\lib”中解析“react/lib/React” - Module not found: Can't resolve 'react/lib/React' in 'C:\Users\name\ecom\node_modules\react-dom\lib' 找不到模块:错误:无法解析“/node_modules/dotenv/lib”中的“fs”-创建反应应用程序 - Module not found: Error: Can't resolve 'fs' in '/node_modules/dotenv/lib' - create react app 错误 - ./node_modules/busboy/lib/main.js:1:0 找不到模块:无法解析“fs” - error - ./node_modules/busboy/lib/main.js:1:0 Module not found: Can't resolve 'fs' 未找到模块:错误:无法解析 'C:\Users\bug\Desktop\wp-test\node_modules\react-render-html\node_modules\parse5\lib\serializer 中的 'util' - Module not found: Error: Can't resolve 'util' in 'C:\Users\bug\Desktop\wp-test\node_modules\react-render-html\node_modules\parse5\lib\serializer 找不到模块:无法使用 Next.js mysql Express React 解析“.../node_modules/destroy”中的“fs” - Module not found: Can't resolve 'fs' in '.../node_modules/destroy' using Next.js mysql Express React 未找到模块:无法解析“C:\\Users\\adcal\\dvmtn7\\myapp\\node_modules\\react-dom\\cjs”中的“计划” - Module not found: Can't resolve 'schedule' in 'C:\Users\adcal\dvmtn7\myapp\node_modules\react-dom\cjs' bcrypt, sequelize ERROR in ../node_modules/node-pre-gyp/lib/publish.js Module not found: Error: Can't resolve 'aws-sdk' - bcrypt, sequelize ERROR in ../node_modules/node-pre-gyp/lib/publish.js Module not found: Error: Can't resolve 'aws-sdk' 无法从 /Users/X/X/node_modules/@react-navigation/native/lib/commonjs/index.js 解析模块。/createAppContainer - Unable to resolve module ./createAppContainer from /Users/X/X/node_modules/@react-navigation/native/lib/commonjs/index.js 找不到模块:无法解析'\\ node_modules \\ react-addons-perf'中的'react-dom / lib / ReactPerf' - Module not found: Can't resolve 'react-dom/lib/ReactPerf' in '\node_modules\react-addons-perf' 找不到模块:无法解析“C:\react-test\src\components\content”中的“node_modules/react” - Module not found: Can't resolve 'node_modules/react' in 'C:\react-test\src\components\content'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM