【问题标题】:Error in stream-browserify when installing React project安装 React 项目时流浏览器出错
【发布时间】:2020-04-02 10:02:04
【问题描述】:

我正在用 jenkins 安装 react 项目,但每次 jenkins 都显示这个问题:

ERROR in ./~/stream-browserify/index.js
Module not found: Error: Can't resolve 'readable-stream/writable.js' in '/data/jenkins/workspace/CHR_CAT_COLLECTE_FRONT/node_modules/stream-browserify'
 @ ./~/stream-browserify/index.js 29:18-56
 @ ./~/browserify-sign/browser/index.js
 @ ./~/crypto-browserify/index.js
 @ ./~/react-tooltip/dist/index.es.js
 @ ./src/components/modules/tournees-collecte/TableResultatRechercheTournee.tsx
 @ ./src/components/modules/tournees-collecte/ModuleTourneesCollecte.tsx
 @ ./src/components/App.tsx
 @ ./src/Index.tsx

ERROR in ./~/stream-browserify/index.js
Module not found: Error: Can't resolve 'readable-stream/duplex.js' in '/data/jenkins/workspace/CHR_CAT_COLLECTE_FRONT/node_modules/stream-browserify'
 @ ./~/stream-browserify/index.js 30:16-52
 @ ./~/browserify-sign/browser/index.js
 @ ./~/crypto-browserify/index.js
 @ ./~/react-tooltip/dist/index.es.js
 @ ./src/components/modules/tournees-collecte/TableResultatRechercheTournee.tsx
 @ ./src/components/modules/tournees-collecte/ModuleTourneesCollecte.tsx
 @ ./src/components/App.tsx
 @ ./src/Index.tsx

ERROR in ./~/stream-browserify/index.js
Module not found: Error: Can't resolve 'readable-stream/transform.js' in '/data/jenkins/workspace/CHR_CAT_COLLECTE_FRONT/node_modules/stream-browserify'
 @ ./~/stream-browserify/index.js 31:19-58
 @ ./~/browserify-sign/browser/index.js
 @ ./~/crypto-browserify/index.js
 @ ./~/react-tooltip/dist/index.es.js
 @ ./src/components/modules/tournees-collecte/TableResultatRechercheTournee.tsx
 @ ./src/components/modules/tournees-collecte/ModuleTourneesCollecte.tsx
 @ ./src/components/App.tsx
 @ ./src/Index.tsx

ERROR in ./~/stream-browserify/index.js
Module not found: Error: Can't resolve 'readable-stream/passthrough.js' in '/data/jenkins/workspace/CHR_CAT_COLLECTE_FRONT/node_modules/stream-browserify'
 @ ./~/stream-browserify/index.js 32:21-62
 @ ./~/browserify-sign/browser/index.js
 @ ./~/crypto-browserify/index.js
 @ ./~/react-tooltip/dist/index.es.js
 @ ./src/components/modules/tournees-collecte/TableResultatRechercheTournee.tsx
 @ ./src/components/modules/tournees-collecte/ModuleTourneesCollecte.tsx
 @ ./src/components/App.tsx
 @ ./src/Index.tsx
Child html-webpack-plugin for "index.html":
       [0] ./~/lodash/lodash.js 541 kB {0} [built]
       [1] ./~/html-webpack-plugin/lib/loader.js!./src/index.html 532 bytes {0} [built]
       [2] (webpack)/buildin/global.js 509 bytes {0} [built]
       [3] (webpack)/buildin/module.js 517 bytes {0} [built]
    
    WARNING in DedupePlugin: This plugin was removed from webpack. Remove it from your configuration.
Child html-webpack-plugin for "index.html":
       [0] ./~/lodash/lodash.js 541 kB {0} [built]
       [1] ./~/html-webpack-plugin/lib/loader.js!./src/index-prod.html 642 bytes {0} [built]
       [2] (webpack)/buildin/global.js 509 bytes {0} [built]
       [3] (webpack)/buildin/module.js 517 bytes {0} [built]
    

谁能帮我解决这个问题?注意到构建最终在之前工作并且没有任何改变。我尝试重建旧版本,但现在也显示相同的错误。

谢谢!

【问题讨论】:

  • 发布你的 webpack module.exports

标签: reactjs jenkins npm webpack


【解决方案1】:

您确定模块文件夹有 resolve 吗?

  resolve: {
    alias: {
        src: path.resolve(__dirname, '..', 'src')
    },
    extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
    modules :{
        node_modules: path.resolve(__dirname, '..', 'node_modules')
    }
},

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-19
    • 1970-01-01
    • 2021-07-11
    • 1970-01-01
    • 2020-10-19
    • 2022-11-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多