angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

ERROR [launcher]: Cannot start PhantomJS #612

Closed mchavezi closed 10 years ago

mchavezi commented 10 years ago

I am on Ubuntu 14.04 droplet with all dependencies installed.

When I run grunt I get this:

Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.24 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
WARN [watcher]: Pattern "/home/myusername/my-new-project/client/bower_components/angular-route/angular-route.js" does not match any file.
WARN [watcher]: Pattern "/home/myusername/my-new-project/client/app/app.coffee" does not match any file.
WARN [watcher]: Pattern "/home/myusername/my-new-project/client/components/**/*.coffee" does not match any file.
WARN [watcher]: Pattern "/home/myusername/my-new-project/client/components/**/*.jade" does not match any file.
ERROR [launcher]: Cannot start PhantomJS

WARN [watcher]: Pattern "/home/myusername/my-new-project/client/app/**/*.coffee" does not match any file.
WARN [watcher]: Pattern "/home/myusername/my-new-project/client/app/**/*.jade" does not match any file.
INFO [launcher]: Trying to start PhantomJS again (1/2).
ERROR [launcher]: Cannot start PhantomJS

INFO [launcher]: Trying to start PhantomJS again (2/2).
ERROR [launcher]: Cannot start PhantomJS

ERROR [launcher]: PhantomJS failed 2 times (cannot start). Giving up.
Warning: Task "karma:unit" failed. Use --force to continue.

Aborted due to warnings.

Execution Time (2014-10-01 07:10:21 UTC)
loading tasks        158ms  ▇▇ 3%
newer:jshint:server  223ms  ▇▇ 5%
jshint:server        417ms  ▇▇▇▇ 9%
jshint:all           236ms  ▇▇▇ 5%
mochaTest:src         1.6s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 33%
injector:css         250ms  ▇▇▇ 5%
autoprefixer:dist    458ms  ▇▇▇▇ 10%
karma:unit            1.2s  ▇▇▇▇▇▇▇▇▇▇▇ 25%
Total 4.8s

Been trying to solve for a couple of days now.

Anybody else have this problem on Ubuntu?

lukeberry99 commented 10 years ago

What version of Node are you running?

DaftMonk commented 10 years ago

This is probably an issue with phantomJS and not the generator.

mchavezi commented 9 years ago

I've been messing around with this again and have made progress in determining the issue. I get warnings like these when running grunt: my-new-project/client/app/app.coffee" does not match any file. my-new-project/client/components/*/.coffee" does not match any file. my-new-project/client/components/*/.jade" does not match any file

Whats interesting is that I didn't choose to install coffee and jade when doing the generator.

I've also tried doing the generator with choosing coffee, jade those components and the error don't happen, instead these errors appear: my-new-project/client/bower_components/angular-route/angular-route.js" does not match any file. my-new-project/client/app/app.js" does not match any file. my-new-project/client/components/*/.js" does not match any file. my-new-project/client/components/*/.html" does not match any file.

Would love to solve this. Its the type of thing that keeps me up at night.

mchavezi commented 9 years ago

Here are the steps I took on a digital ocean droplet: apt-get update apt-get install nodejs npm mongodb git nano npm install --global n n stable npm install grunt-cli -g npm install -g bower npm install yeoman-generator chalk wiredep generator-ng-component npm install generator-angular-fullstack npm install -g generator-angular-fullstack

adduser demo

visudo

demo ALL=(ALL:ALL) ALL

su - demo

mkdir my-new-project && cd $_

MelissaMMDP commented 9 years ago

@bigbassroller I'm receiving the same watcher warning and also did not choose to install coffee or jade. Did you figure out the cause?

I figured it out ... the issue was in the karma.conf.js file. Even though I did not ask to include coffee or jade they are being included in the patterns to load in the browser and also in the preprocessors. The generator code needs to be updated to not include these files in the test configuration or they need to be commented out manually.

Now that they are commented out as shown below the test runs successfully without the warn message:

// list of files / patterns to load in the browser
files: [
  'client/bower_components/jquery/dist/jquery.js',
  'client/bower_components/angular/angular.js',
  'client/bower_components/angular-mocks/angular-mocks.js',
  'client/bower_components/angular-resource/angular-resource.js',
  'client/bower_components/angular-cookies/angular-cookies.js',
  'client/bower_components/angular-sanitize/angular-sanitize.js',
  'client/bower_components/angular-route/angular-route.js',
  'client/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
  'client/bower_components/lodash/dist/lodash.compat.js',
  'client/app/app.js',
  //'client/app/app.coffee',
  'client/app/**/*.js',
  //'client/app/**/*.coffee',
  'client/components/**/*.js',
  //'client/components/**/*.coffee',
  //'client/app/**/*.jade',
  //'client/components/**/*.jade',
  'client/app/**/*.html',
  'client/components/**/*.html'
],

preprocessors: {
  //'**/*.jade': 'ng-jade2js',
  '**/*.html': 'html2js'
  //'**/*.coffee': 'coffee',
},

I know the warn message isn't hurting anything but I also lose sleep over these things ;)