question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Brunch 3.0.0 - Error: Cannot find module 'readable-stream/duplex'

See original GitHub issue

Description

A module seems to be missing

Expected behavior

Brunch should load and build

Actual behavior

Error happens when building

Environment

  1. Brunch: 3.0.0
  2. Node.js: 12.13.1 (LTS)
  3. NPM: 6.12.1
  4. Operating system: Linux Fedora 31
  5. Code editor: Atom

package.json contents

{
    "private": true,
    "devDependencies": {
        "brunch": "^3.0.0"
    }
}

brunch config contents

module.exports = {
  paths: {
    public: 'public/assets/',
    watched: ['resources/js', 'resources/sass']
  },
  files: {
    javascripts: {
      joinTo: {
        'javascripts/app.js': /^app/,
        'javascripts/vendor.js': /^(?!app)/
      }
    },
    stylesheets: {joinTo: 'app.css'},
  }
}

Other useful files, when present (log, bower.json etc.)

Brunch: Local install exists, but failed to load it. Continuing with global install: Error: Cannot find module 'readable-stream/duplex'
Require stack:
- /path/to/project/node_modules/node-browser-modules/index.js
- /path/to/project/node_modules/deppack/lib/shims.js
- /path/to/project/node_modules/deppack/lib/modules.js
- /path/to/project/node_modules/deppack/lib/deppack.js
- /path/to/project/node_modules/deppack/index.js
- /path/to/project/node_modules/brunch/lib/fs_utils/write.js
- /path/to/project/node_modules/brunch/lib/watch.js
- /path/to/project/node_modules/brunch/lib/index.js
- /path/to/project/node_modules/brunch/lib/cli.js
- /path/to/project/node_modules/brunch/bin/brunch
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.resolve (internal/modules/cjs/helpers.js:80:19)
    at Object.<anonymous> (/path/to/project/node_modules/node-browser-modules/index.js:27:33)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/path/to/project/node_modules/deppack/lib/shims.js:3:18) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/path/to/project/node_modules/node-browser-modules/index.js',
    '/path/to/project/node_modules/deppack/lib/shims.js',
    '/path/to/project/node_modules/deppack/lib/modules.js',
    '/path/to/project/node_modules/deppack/lib/deppack.js',
    '/path/to/project/node_modules/deppack/index.js',
    '/path/to/project/node_modules/brunch/lib/fs_utils/write.js',
    '/path/to/project/node_modules/brunch/lib/watch.js',
    '/path/to/project/node_modules/brunch/lib/index.js',
    '/path/to/project/node_modules/brunch/lib/cli.js',
    '/path/to/project/node_modules/brunch/bin/brunch'
  ]
}
Cannot find module 'readable-stream/duplex'
Require stack:
- /path/to/project/node_modules/node-browser-modules/index.js
- /path/to/project/node_modules/deppack/lib/shims.js
- /path/to/project/node_modules/deppack/lib/modules.js
- /path/to/project/node_modules/deppack/lib/deppack.js
- /path/to/project/node_modules/deppack/index.js
- /path/to/project/node_modules/brunch/lib/fs_utils/write.js
- /path/to/project/node_modules/brunch/lib/watch.js
- /path/to/project/node_modules/brunch/lib/index.js
- /path/to/project/node_modules/brunch/lib/cli.js
- /path/to/project/node_modules/brunch/bin/brunch

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
paulmillrcommented, Dec 16, 2019

You’ll need to do rm -rf node_modules package-lock.json && npm install

0reactions
Arcesilascommented, Dec 16, 2019

Oh ! I also currently have a browser-sync with brunch 2 running.

EDIT: And that was it 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

brunch: Cannot find module "initialize" from "/" - Stack Overflow
Problem was: I configured brunch to look for the vendor js files in /^vendor/ , but they were in app/vendor. Copied the folder...
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >
r/Tdarr - Reddit
Plugin error! Error: Cannot find module '../methods/lib'. Setting up Tdarr for the first time with Docker. I have followed a video and am ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found