1

I am trying to install this github sample Angular2 app written in JavaScript, but the app fails to lead in the browser. I am including a print screen below that shows the FireFox console reporting it was not able to find boot.css. What specific steps or changes do I need to make in order for the example app to successfully launch?

Per the instructions at the link above, I typed the following into the CentOS 7 terminal:

git clone https://github.com/blacksonic/angular2-esnext-starter.git
cd angular2-esnext-starter
npm install

gulp serve

The terminal then printed the following:

[user@localhost angular2-esnext-starter]$ gulp serve
[14:50:17] Using gulpfile ~/nodejs_apps/angular2-esnext-starter/gulpfile.js
[14:50:17] Starting 'serve'...
[14:50:17] Starting 'clean'...
[14:50:17] Finished 'clean' after 38 ms
[14:50:17] Starting 'client-build'...
[14:50:17] Starting 'client-copy'...
[14:50:17] Starting 'client-stylesheet'...
[14:50:17] Starting 'livereload'...
[14:50:17] Finished 'livereload' after 2.43 ms
[14:50:18] Finished 'client-stylesheet' after 808 ms
[14:50:19] Finished 'client-copy' after 1.61 s
[14:50:23] Finished 'client-build' after 5.94 s
[14:50:23] Starting 'server-start'...
[14:50:23] Finished 'server-start' after 1.36 ms
[14:50:23] Finished 'serve' after 5.98 s
[14:50:23] [nodemon] 1.9.2
[14:50:23] [nodemon] to restart at any time, enter `rs`
[14:50:23] [nodemon] watching: /home/user/nodejs_apps/angular2-esnext-starter/server/**/*
[14:50:23] [nodemon] starting `node server/index.js`
[14:50:24] [nodemon] Internal watch failed: watch /home/user/nodejs_apps/angular2-esnext-starter/server/config.js ENOSPC

And then I got the following in the browser:

To confirm that I had at least version 4+ of Node.js installed, I then typed the following, and got the following response:

[user@localhost angular2-esnext-starter]$ node --version
v5.12.0
FirstOfMany
  • 185
  • 2
  • 7
  • Note: The application needs at least Node 4+ installed. ? – Aistis Taraskevicius Jul 22 '16 at 22:09
  • It says `ENOSPC` right at the end, have a look at the answers here: http://stackoverflow.com/questions/22475849/node-js-error-enospc – chrki Jul 22 '16 at 22:17
  • @AistisTaraskevicius I just added a note to the end of the OP showing that Node.js version 5.12.0 is installed. – FirstOfMany Jul 22 '16 at 22:18
  • @chrki OK, but this is on a virtual machine whose disk size can grow arbitrarily large. And the host OS has almost a terabyte of empty space on its real hard drive. – FirstOfMany Jul 22 '16 at 22:23
  • @FirstOfMany Read beyond the 1st answer, it seems to be not just a hard disk space problem – chrki Jul 22 '16 at 22:24
  • @chrki The problem was solved by typing `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`. If you want to write an answer that explains what that command is doing, you would be improving upon the link you posted, and I would mark it as +1 accepted. – FirstOfMany Jul 22 '16 at 22:26

1 Answers1

1

The problem is right at the end of your logs: ENOSPC

According to another question this can be caused by either having not enough disk space, or by exhausting the number of files a process can watch.

In your case it's likely that the nodejs process has reached the default number of files it can watch. In the gulpfile.js settings file the livereload command is configured - it "watches" the directory and its files and triggers a reload when something changes. Although there are only 83 files in the repository it's possible that all the installed dependencies (found inside the package.json file, installed via npm install) make it reach the file watch limit.

Community
  • 1
  • 1
chrki
  • 6,143
  • 6
  • 35
  • 55