'Error: Can't walk dependency graph with web3 browserify

I am trying to browserify a node project with require() in the main.js file. It's working for the other modules but if I add

const Web3 = require('web3')

It's giving me this error:

Error: Can't walk dependency graph: Cannot find module 'builtin-status-codes' from '/usr/local/lib/node_modules/browserify/node_modules/stream-http/index.js'
    required by /usr/local/lib/node_modules/browserify/node_modules/stream-http/index.js
    at /usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:146:35
    at processDirs (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:299:39)
    at isdir (/usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:306:32)
    at /usr/local/lib/node_modules/browserify/node_modules/resolve/lib/async.js:34:69

I have it installed though so I'm not sure why I'm getting this error.

Edit: It's working now, files were just missing in the builtin-status-codes folder. Must have been because of errors in the installation.



Sources

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

Source: Stack Overflow

Solution Source