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.

Missing module after running brunch watch -s

See original GitHub issue

Description

Hello, I am having real issues with brunch at the moment. The error is not very consistent because it has not happened in 10hrs but it seems that sometimes when I run brunch watch -s I lose some of the configuration of the files and it throws these warnings followed by the following error below:

01 Apr 09:21:22 - warn: config.files.javascripts.defaultPaths was removed
01 Apr 09:21:22 - warn: config.files.stylesheets.defaultPaths was removed
01 Apr 09:21:22 - warn: config.files.templates.defaultPaths was removed
01 Apr 09:21:22 - error: Initialization error - You probably need to execute `npm install` to install brunch plugins. Error: Cannot find module './lib/core.js'

I have no idea why it suddenly loses the paths and ./lib/core.js module. I follow the instructions it gives me and reinstall brunch with npm install, do a brunch watch -s again, it is also worth pointing that it labels brunch as extraneous (whatever that means)

package-name@0.0.1 /Users/lcouto/.Trash/dk-find-out 15.24.21
├── brunch@2.5.3  extraneous
└── node-sass@3.4.2  extraneous

This still does not work. I then proceed in installing brunch globally npm install brunch -g. But I get the same error and instruction to do an npm install again. I keep going around in circles with this. What on earth is happening?

Environment

  1. Brunch: 2.5.3
  2. Node:v4.4.1
  3. NPM:3.8.3
  4. Operating system: MAC OX Yosemite 10.10.5

package.json contents

  "author": "Your Name",
  "name": "package-name",
  "description": "Package description",
  "version": "0.0.1",
  "homepage": "",
  "repository": {
    "type": "git",
    "url": ""
  },
  "engines": {
    "node": "~0.6.10"
  },
  "scripts": {
    "start": "brunch watch -s",
    "test": "brunch test"
  },
  "dependencies": {
    "autoprefixer": "^6.3.5",
    "clean-css-brunch": ">= 1.0 < 1.4",
    "css-brunch": ">= 1.0 < 1.4",
    "handlebars-brunch": ">= 1.0 < 1.4",
    "javascript-brunch": ">= 1.0 < 1.6",
    "postcss-brunch": "^0.5.0",
    "sass-brunch": "^1.9.2",
    "uglify-js-brunch": ">= 1.0 < 1.4"
  },
  "devDependencies": {
    "chai": "1.2.0",
    "sinon": "1.4.2",
    "sinon-chai": "2.1.2"
  }
}

brunch config contents

exports.config =
  # Edit the next line to change default build path.
  paths:
    public: 'public'

  plugins:
    postcss:
      processors: [
        require('autoprefixer')(['last 8 versions'])
      ]

  files:
    javascripts:
      # Defines what file will be generated with `brunch generate`.
      defaultExtension: 'js'
      # Describes how files will be compiled & joined together.
      # Available formats:
      # * 'outputFilePath'
      # * map of ('outputFilePath': /regExp that matches input path/)
      # * map of ('outputFilePath': function that takes input path)
      joinTo:
        'javascripts/app.js': /^app/
        'javascripts/vendor.js': /^vendor/
        'test/javascripts/test.js': /^test(\/|\\)(?!vendor)/
        'test/javascripts/test-vendor.js': /^test(\/|\\)(?=vendor)/
      # Defines compilation order.
      # `vendor` files will be compiled before other ones
      # even if they are not present here.
      order:
        before: [
          'vendor/scripts/console-helper.js',
          'vendor/scripts/modernizr.custom.50279.js',
          'vendor/scripts/jquery-1.8.2.min.js',
          'vendor/scripts/jquery-ui.js',
          'vendor/scripts/respond.min.js',
          'vendor/scripts/underscore-1.4.4.js',
          'vendor/scripts/backbone-1.0.0.js',
          'vendor/scripts/backbone-mediator.js',
          'vendor/scripts/tappable-9.9.9.js',
          'vendor/scripts/jquery.hammer.js',
          'vendor/scripts/masonry.pkgd.js',
          'vendor/scripts/jquery.mCustomScrollbar.js',
          'vendor/scripts/jquery.ui.touch-punch.js'

          # Twitter Bootstrap jquery plugins
          #'vendor/scripts/bootstrap/bootstrap-transition.js',
          #'vendor/scripts/bootstrap/bootstrap-alert.js',
          #'vendor/scripts/bootstrap/bootstrap-button.js',
          #'vendor/scripts/bootstrap/bootstrap-carousel.js',
          #'vendor/scripts/bootstrap/bootstrap-collapse.js',
          #'vendor/scripts/bootstrap/bootstrap-dropdown.js',
          #'vendor/scripts/bootstrap/bootstrap-modal.js',
          #'vendor/scripts/bootstrap/bootstrap-tooltip.js',
          #'vendor/scripts/bootstrap/bootstrap-popover.js',
          #'vendor/scripts/bootstrap/bootstrap-scrollspy.js',
          #'vendor/scripts/bootstrap/bootstrap-tab.js',
          #'vendor/scripts/bootstrap/bootstrap-typeahed.js'
        ]
        after: [
          'test/vendor/scripts/test-helper.js'
        ]

    stylesheets:
      defaultExtension: 'less'
      joinTo:
        'stylesheets/app.css': /^(app|vendor)/
        'test/stylesheets/test.css': /^test/
      # moved all scss files to before
      # using after was temperamental
      order:
       before: [
         'app/styles/mixins.scss',
         'app/styles/main.scss',
         'app/styles/header.scss',
         'app/styles/footer.scss',
         'app/styles/articles.scss',
         'app/styles/landing.scss',
         'app/styles/search.scss',
         'app/styles/gallery.scss',
         'app/styles/video.scss',
         'app/styles/quiz.scss',
         'app/styles/explore.scss',
         'app/styles/hover.scss',
         'app/styles/ie.scss'
       ]
       after: [
       ]
  # Updated to sass-brunch@1.9
  # Added new path for sass files.
      defaultExtension: 'scss'
      joinTo:
        'stylesheets/app.css': /^app\/styles/
        'stylesheets/global.css': /^app\/sass\/config/

    templates:
      defaultExtension: 'hbs'
      joinTo: 'javascripts/app.js'

  # Change this if you're using something other than backbone (e.g. 'ember').
  # Content of files, generated with `brunch generate` depends on the setting.
  # framework: 'backbone'

  # Settings of web server that will run with `brunch watch [--server]`.
  # server:
  #   # Path to your server node.js module.
  #   # If it's commented-out, brunch will use built-in express.js server.
  #   path: 'server.coffee'
  #   port: 3333
  #   # Run even without `--server` option?
  #   run: yes

Unfortunately I am unable to create a demo app but I hope that the information above gives you enough info.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Florian-Rcommented, Apr 6, 2016

@goshakkk Can reproduce with the dead-simple-skeleton. Seems related to Linux and fs.write, see https://github.com/Microsoft/vscode/issues/4727

0reactions
robbiewxyzcommented, Jun 1, 2016

I guess that us getting these issues more than Gulp/Webpack/etc means Brunch is fast enough the OS can’t keep up. So yay Brunch! 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Brunch builds but "Cannot find module 'buffer'" on open
Brunch takes the steps of the build pipeline from the (brunch specific) npm packages defined in the package.json .
Read more >
Wi-fi adapter disappeared after installing Brunch : r/Brunchbook
As I understood the WiFi module from Broadcom. I tried some other chromeos. CloudReady - WiFi working, sound not working, bt not working....
Read more >
Brunch: Config
Brunch builds, lints, compiles, concatenates and shrinks your HTML5 app in an ultra-simple way. No more Grunt / Gulp mess.
Read more >
brunch - UNPKG
* You can now simply set `config.modules = false` to disable module wrapping. 84, * Brunch would now correctly include file-based ...
Read more >
What is a misplaced modifier
Now it is the watch that is gold. There are several kinds of misplaced modifiers: 1. Misplaced adjectives are incorrectly separated from the...
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