devbridge / Styleguide

MIT License
1.44k stars 87 forks source link

Setup error: Not found #174

Closed dlewand691 closed 8 years ago

dlewand691 commented 8 years ago

Trying to get setup and receiving this error Error: Not Found at /usr/local/lib/node_modules/devbridge-styleguide/app.js:36:13 at Layer.handle [as handle_request] (/usr/local/lib/node_modules/devbridge-styleguide/node_modules/express/lib/router/layer.js:82:5) at trim_prefix (/usr/local/lib/node_modules/devbridge-styleguide/node_modules/express/lib/router/index.js:302:13) at /usr/local/lib/node_modules/devbridge-styleguide/node_modules/express/lib/router/index.js:270:7 at Function.proto.process_params (/usr/local/lib/node_modules/devbridge-styleguide/node_modules/express/lib/router/index.js:321:12) at next (/usr/local/lib/node_modules/devbridge-styleguide/node_modules/express/lib/router/index.js:261:10) at /usr/local/lib/node_modules/devbridge-styleguide/app.js:27:3 at Layer.handle [as handle_request] (/usr/local/lib/node_modules/devbridge-styleguide/node_modules/express/lib/router/layer.js:82:5) at trim_prefix (/usr/local/lib/node_modules/devbridge-styleguide/node_modules/express/lib/router/index.js:302:13) at /usr/local/lib/node_modules/devbridge-styleguide/node_modules/express/lib/router/index.js:270:7

Running a Mac, OSX 10.11.5. Node, Gulp and Grunt installed, running RVM as well. No localhost/server software like MAMP, etc. What am I missing. Thank you!

VaclovasV commented 8 years ago

@miezis - got any ideas?

kestutis-buivydas commented 8 years ago

Looks like 404 error. @dlewand691 are you trying to open http://your-project-url/styleguide ?

dlewand691 commented 8 years ago

Running it locally and trying to access it via http://localhost:8889/styleguide and getting that error.

I am running files from a Dropbox folder which could be causing the issue.

kestutis-buivydas commented 8 years ago

@dlewand691 http://localhost:8889/ is used only to expose API for styleguide data manipulation. In order to view the styleguide in the browser, you need to run your own project’s server.

andrewkdouglas commented 8 years ago

@dlewand691

Try installing live-server and using that in Gulp (or Grunt if that is your tipple). Here's a snippet from my gulp file.

var styleguide = require('devbridge-styleguide');
var liveServer = require("live-server");

gulp.task('start-styleguide', function () {
  styleguide.startServer();

  var params = {
    port: 8181, // Set the server port. Defaults to 8080.
    file: "index.html", // When set, serve this file for every 404 (useful for single-page applications)
    wait: 100, // Waits for all changes, before reloading. Defaults to 0 sec.
    logLevel: 2 // 0 = errors only, 1 = some, 2 = lots
  };
  liveServer.start(params);
dlewand691 commented 8 years ago

Got it running on a localhost server, everything is installed globally and locally, and now I'm getting a "gulp is not defined" error. Here's what it's outputting:

/Users/ctsuser1/Desktop/Styleguide/Cognizant LivingStyleGuide/gulpfile.js:4
gulp.task('start-styleguide', function() {
^

ReferenceError: gulp is not defined
    at Object.<anonymous> (/Users/ctsuser1/Desktop/Styleguide/Cognizant LivingStyleGuide/gulpfile.js:4:1)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)
    at Liftoff.<anonymous> (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:193:16)

And here is my gulpfile.js:

var styleguide = require('devbridge-styleguide');
var liveServer = require("live-server");

gulp.task('start-styleguide', function() {
    styleguide.startServer();

    var params = {
        port: 8181, // Set the server port. Defaults to 8080.
        file: "index.html", // When set, serve this file for every 404 (useful for single-page applications)
        wait: 100, // Waits for all changes, before reloading. Defaults to 0 sec.
        logLevel: 2 // 0 = errors only, 1 = some, 2 = lots
    };
    liveServer.start(params);
});

Any thoughts?

dlewand691 commented 8 years ago

Just got it working by running styleguide start instead and firing up a localhost server using php -S localhost:8889 in the project directory. Not sure if everything is compiling right yet or not, but at least it's running now!

miezis commented 8 years ago

Your gulpfile is incorrect, you're not importing gulp and that's not related to styleguide itself. Here's what's missing: var gulp = require('gulp');

dlewand691 commented 8 years ago

Ah, thank you. Duh. Got that running, now I'm getting:

(node:80717) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[13:12:06] Using gulpfile ~/Desktop/Styleguide/Cognizant LivingStyleGuide/gulpfile.js
[13:12:06] Starting 'start-styleguide'...
[13:12:06] Finished 'start-styleguide' after 2.05 ms
Styleguide server listening on port 8889

Seems the graceful-fs module needs updating.

Also, how do I enter edit mode? There's no "scrape variables" button and there's not much documentation on it.