找不到模块:无法在React应用程序的node_modules \ minio \ dist \ main和node_modules \ mkdirp中解析“ fs”

时间:2020-06-04 08:43:46

标签: javascript reactjs npm node-modules minio

我正在尝试从UI的minio存储桶中获取图像,因此我使用npm install --save minio安装了minio,然后使用const Minio = require("minio");将其导入了一个jsx文件中,所以开始出现错误,

ERROR in ./node_modules/minio/dist/main/minio.js
Module not found: Error: Can't resolve 'fs' in 'D:\Solutions\ui\node_modules\minio\dist\main'
 @ ./node_modules/minio/dist/main/minio.js 13:33-46
 @ ./src/SearchResultPreview/search-result-preview.jsx
 @ ./src/Search/search.jsx
 @ ./src/search-with-context.jsx
 @ ./src/sme/Sme.js
 @ ./src/App.js
 @ ./src/index.jsx
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.jsx

ERROR in ./node_modules/mkdirp/index.js
Module not found: Error: Can't resolve 'fs' in 'D:\Solutions\ui\node_modules\mkdirp'
 @ ./node_modules/mkdirp/index.js 2:9-22
 @ ./node_modules/minio/dist/main/minio.js
 @ ./src/SearchResultPreview/search-result-preview.jsx
 @ ./src/Search/search.jsx
 @ ./src/search-with-context.jsx
 @ ./src/sme/Sme.jsx
 @ ./src/App.js
 @ ./src/index.jsx
 @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.jsx

由于错误:无法解决'fs'问题,请帮助我解决该问题,我无法进一步处理,它给我const Minio = require("minio");上的错误只要。我尝试删除节点模块和程序包锁定并再次安装,但这对我没有帮助。

0 个答案:

没有答案