'Error in stream-browserify when installing React project

I'm installing react project with jenkins but every time jenkins shows this problem:

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]
    

Can anyone help me resolve this problem? Noted that the build works finally before and there is nothing changed. I tried to rebuild an old build but it shows the same error also now.

Thanks!



Solution 1:[1]

Are you sure there is a resolve for the modules folder?

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bonney