Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser sync failure on Centos 7 #1408

Closed
1 of 6 tasks
dodozhang21 opened this issue Jul 13, 2017 · 2 comments
Closed
1 of 6 tasks

Browser sync failure on Centos 7 #1408

dodozhang21 opened this issue Jul 13, 2017 · 2 comments

Comments

@dodozhang21
Copy link

dodozhang21 commented Jul 13, 2017

Issue details

When I executed the following command

sudo ./node_modules/browser-sync/bin/browser-sync.js start --files "**/*.hbs, **/*.js, **/*.css" --port 80 --proxy localhost:3000 --no-ui --no-open

It fails with the following.

[BS] Proxying: http://localhost:3000
[BS] Access URLs:
 ----------------------------------
    Local: http://localhost:80
 External: http://##.##.##.##:80
 ----------------------------------
[BS] Watching files...
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: watch node_modules/sass-graph/node_modules/lodash/_baseRange.js ENOSPC
    at exports._errnoException (util.js:1018:11)
    at FSWatcher.start (fs.js:1443:19)
    at Object.fs.watch (fs.js:1470:11)
    at createFsWatchInstance (/var/www/html/multi-tenant/mdp.node.mtstarter/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/var/www/html/multi-tenant/mdp.node.mtstarter/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/var/www/html/multi-tenant/mdp.node.mtstarter/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleFile (/var/www/html/multi-tenant/mdp.node.mtstarter/node_modules/chokidar/lib/nodefs-handler.js:255:21)
    at FSWatcher.<anonymous> (/var/www/html/multi-tenant/mdp.node.mtstarter/node_modules/chokidar/lib/nodefs-handler.js:473:21)
    at FSReqWrap.oncomplete (fs.js:123:15)

npm ERR! Linux 3.10.0-514.21.2.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "run" "browser-sync"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] browser-sync: `./node_modules/browser-sync/bin/browser-sync.js start --files "**/*.hbs, **/*.js, **/*.css" --port 80 --proxy localhost:3000 --no-ui --no-open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] browser-sync script './node_modules/browser-sync/bin/browser-sync.js start --files "**/*.hbs, **/*.js, **/*.css" --port 80 --proxy localhost:3000 --no-ui --no-open'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mdp.node.mtstarter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./node_modules/browser-sync/bin/browser-sync.js start --files "**/*.hbs, **/*.js, **/*.css" --port 80 --proxy localhost:3000 --no-ui --no-open
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs mdp.node.mtstarter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls mdp.node.mtstarter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/html/multi-tenant/mdp.node.mtstarter/npm-debug.log

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [ 2.18.12 ]
  • Node [ 6.10.3 ]
  • Npm [ 3.10.10 ]

Affected platforms

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)

The same command works fine on my OS X.

Does anyone have any idea why this happens?

@dodozhang21
Copy link
Author

dodozhang21 commented Jul 13, 2017

Here's my entire package.json

{
  "name": "mdp.node.mtstarter",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www",
    "dev": "NODE_ENV=local PORT=3000 DEBUG=mdp.node.mtstarter:* node ./bin/www",
    "nodemon": "./node_modules/nodemon/bin/nodemon.js --config nodemon.json --exec npm run dev -V --ignore public",
    "json": "./node_modules/json-server/bin/index.js --watch test/fixtures/data.json --port 3001",
    "test": "./node_modules/.bin/mocha --timeout 10000",
    "single_test": "./node_modules/.bin/mocha --timeout 10000 --grep",
    "scss:watch": "./node_modules/node-sass/bin/node-sass scss/ --output=public/stylesheets/ --output-style=expanded --include-path=./node_modules/compass-mixins/lib -w",
    "livereload": "./node_modules/livereload/bin/livereload.js . -w 1000 -e 'js,css,hbs'",
    "local_client": "./node_modules/concurrently/src/main.js --kill-others \"npm run scss:watch\" \"npm run livereload\"",
    "local_server_with_json": "./node_modules/concurrently/src/main.js --kill-others \"npm run json\" \"npm run nodemon\"",
    "local_all": "./node_modules/concurrently/src/main.js --kill-others \"npm run json\" \"npm run nodemon\" \"npm run scss:watch\"",
    "jshint": "./node_modules/jshint/bin/jshint app.js",
    "browser-sync": "./node_modules/browser-sync/bin/browser-sync.js start --files \"**/*.hbs, **/*.js, **/*.css\" --port 80 --proxy localhost:3000 --no-ui --no-open"
  },
  "dependencies": {
    "axios": "^0.16.2",
    "body-parser": "~1.17.1",
    "cookie-parser": "~1.4.3",
    "debug": "~2.6.3",
    "express": "~4.15.2",
    "hbs": "~4.0.1",
    "morgan": "~1.8.1",
    "mout": "^1.0.0",
    "serve-favicon": "~2.4.2",
    "winston": "^2.3.1"
  },
  "devDependencies": {
    "browser-sync": "^2.18.12",
    "chai": "^4.0.2",
    "cheerio": "^1.0.0-rc.2",
    "compass-mixins": "git+https://github.com/Igosuki/compass-mixins.git#1.0.2",
    "concurrently": "^3.5.0",
    "express-writer": "0.0.4",
    "jshint": "^2.9.5",
    "json-server": "^0.11.2",
    "livereload": "^0.6.2",
    "mocha": "^3.4.2",
    "moxios": "^0.4.0",
    "node-sass": "^4.5.3",
    "nodemon": "^1.11.0",
    "sass-graph": "^2.2.4",
    "supertest": "^3.0.0"
  }
}

@dataxp
Copy link

dataxp commented Jan 10, 2018

Try with this command:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Source: NodeJS Error: ENOSPC

It solved the problem for us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants