lefos987 / generator-ghurt Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
$ yo ghurt:hapi
(and accept all the default settings)$ npm start
$ npm start
> [email protected] start /Users/pdehaan/dev/tmp/hapi-test-5
> node server.js
/Users/pdehaan/dev/tmp/hapi-test-5/node_modules/hapi/node_modules/hoek/lib/index.js:425
throw new Error(msgs.join(' ') || 'Unknown error');
^
Error: Invalid server options {
"maxSockets": null,
"router": {
"isCaseSensitive": true,
"stripTrailingSlash": false
},
"state": {
"cookies": {
"parse": true,
"failAction": "error",
"clearInvalid": false,
"strictHeader": true
}
},
"location": "",
"payload": {
"maxBytes": 1048576,
"uploads": "/var/folders/qc/g_f0szh95k1fzph34rhmf5jw0000gp/T/"
},
"validation": null,
"json": {
"replacer": null,
"space": null,
"suffix": null
},
"files": {
"relativeTo": ".",
"etagsCacheMaxSize": 10000
},
"timeout": {
"client": 10000,
"server": false
},
"load": {
"maxHeapUsedBytes": 0,
"maxRssBytes": 0,
"maxEventLoopDelay": 0,
"sampleInterval": 0
},
"debug": {
"request": [
"implementation"
]
},
"labels": [],
"cors": true,
"security": false,
"cache" [1, 4]: {
"engine": "redis",
"partition": "cm"
}
}
[1] cache must be a Function
[2] engine must be an object
[3] engine must be a Function
[4] cache must be an array
at Object.exports.assert (/Users/pdehaan/dev/tmp/hapi-test-5/node_modules/hapi/node_modules/hoek/lib/index.js:425:11)
at Object.exports.assert (/Users/pdehaan/dev/tmp/hapi-test-5/node_modules/hapi/lib/schema.js:15:10)
at new module.exports.internals.Server (/Users/pdehaan/dev/tmp/hapi-test-5/node_modules/hapi/lib/server.js:75:12)
at Object.exports.createServer (/Users/pdehaan/dev/tmp/hapi-test-5/node_modules/hapi/lib/index.js:14:12)
at Object.<anonymous> (/Users/pdehaan/dev/tmp/hapi-test-5/server.js:16:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the foo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls foo
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "start"
npm ERR! cwd /Users/pdehaan/dev/tmp/hapi-test-5
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/pdehaan/dev/tmp/hapi-test-5/npm-debug.log
npm ERR! not ok code 0
UPDATE: The workaround seems to be changing from this (server.js#L16):
// var server = Hapi.createServer('0.0.0.0', config.port, options);
... to this:
var server = Hapi.createServer('0.0.0.0', config.port, { cors: true });
$ grunt serve
Running "serve" task
DEBUG: Running node-supervisor with
DEBUG: program 'server.js'
DEBUG: --watch '.'
DEBUG: --ignore 'undefined'
DEBUG: --extensions 'node,js'
DEBUG: --exec 'node'
DEBUG: Starting child process with 'node server.js'
DEBUG: Watching directory '/Users/pk/Documents/dev/hapi-playground/generator-ghurt' for changes.
/Users/pk/Documents/dev/hapi-playground/generator-ghurt/server.js:17
var server = Hapi.createServer('0.0.0.0', config.port, options);
^
TypeError: Object #<Object> has no method 'createServer'
at Object.<anonymous> (/Users/pk/Documents/dev/hapi-playground/generator-ghurt/server.js:17:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
DEBUG: Program node server.js exited with code 8
DEBUG: Starting child process with 'node server.js'
/Users/pk/Documents/dev/hapi-playground/generator-ghurt/server.js:17
var server = Hapi.createServer('0.0.0.0', config.port, options);
^
TypeError: Object #<Object> has no method 'createServer'
at Object.<anonymous> (/Users/pk/Documents/dev/hapi-playground/generator-ghurt/server.js:17:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
DEBUG: Program node server.js exited with code 8
DEBUG: Starting child process with 'node server.js'
$ yo ghurt
_-----_
| |
|--(o)--| .--------------------------.
`---------´ | Welcome to Yeoman, |
( _´U`_ ) | ladies and gentlemen! |
/___A___\ '__________________________'
| ~ |
__'.___.'__
´ ` |° ´ Y `
We need some information about your app to automagically create it...
[?] What is the name of your application? ghurt
[?] Can you give us a brief description?
[?] What version is it on? 0.0.1
[?] Who is the author? Ihor
[?] What is the home URL of the GIT repo?
[?] Under which license is it created? MIT
[?] Are you creating a: Client and Server app?
invoke ghurt:angular
__ __ __
/\ |\ | / _` | | | /\ |__) | /__`
/--\ | \| \__> \__/ |___ /--\ | \ . \__/ .__/
client side ----------------------------------
[?] What port do yo want your livereload server to run on? 50300
[?] Do you want a quick install? No
We know that you want Angular but need to ask you a couple more things...
[?] Which version of Angular do you want? latest
[?] Which other angular modules do you need? angular-route
Angular is great but you might need some other libraries...
[?] Choose the libraries you need... jquery, moment, d3
Really? Angular with Jquery? You better know what you are doing... :-P
[?] Please write your excuse here: oops :)
[?] Do you want to include styles (with Zurb Foundation)? Yes
[?] Which version of Zurb Foundation do you want? latest
create package.json
create .jshintrc
create gruntFile.js
create .bowerrc
create .gitignore
create src/index.html
create src/app/app.js
create src/app/app.view.html
create src/app/common/dependencies.js
create src/app/common/common.js
create src/styles/config.rb
create src/styles/scss/foundation.scss
create src/styles/scss/_variables.scss
create test/config/karma.conf.js
create test/config/protractorConf.js
create dist/vendor/bower.json
[?] Do you want to generate an object (controller, factory..)? No
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No README data
bower d3#* not-cached git://github.com/mbostock/d3.git#*
bower d3#* resolve git://github.com/mbostock/d3.git#*
bower foundation#* not-cached git://github.com/zurb/bower-foundation.git#*
bower foundation#* resolve git://github.com/zurb/bower-foundation.git#*
bower angular-route#* not-cached git://github.com/angular/bower-angular-route.git#*
bower angular-route#* resolve git://github.com/angular/bower-angular-route.git#*
bower angular#* cached git://github.com/angular/bower-angular.git#1.3.8
bower angular#* validate 1.3.8 against git://github.com/angular/bower-angular.git#*
bower jquery#* cached git://github.com/jquery/jquery.git#2.1.3
bower jquery#* validate 2.1.3 against git://github.com/jquery/jquery.git#*
bower moment#* cached git://github.com/moment/moment.git#2.8.4
bower moment#* validate 2.8.4 against git://github.com/moment/moment.git#*
bower angular-mocks#* cached git://github.com/angular/bower-angular-mocks.git#1.3.8
bower angular-mocks#* validate 1.3.8 against git://github.com/angular/bower-angular-mocks.git#*
bower foundation#* download https://github.com/zurb/bower-foundation/archive/5.5.0.tar.gz
bower d3#* download https://github.com/mbostock/d3/archive/v3.5.3.tar.gz
bower angular-route#* download https://github.com/angular/bower-angular-route/archive/v1.3.8.tar.gz
bower angular-route#* extract archive.tar.gz
bower angular-route#* resolved git://github.com/angular/bower-angular-route.git#1.3.8
bower foundation#* extract archive.tar.gz
bower foundation#* resolved git://github.com/zurb/bower-foundation.git#5.5.0
bower modernizr#>= 2.7.2 not-cached git://github.com/Modernizr/Modernizr.git#>= 2.7.2
bower modernizr#>= 2.7.2 resolve git://github.com/Modernizr/Modernizr.git#>= 2.7.2
bower fastclick#>=0.6.11 not-cached git://github.com/ftlabs/fastclick.git#>=0.6.11
bower fastclick#>=0.6.11 resolve git://github.com/ftlabs/fastclick.git#>=0.6.11
bower jquery-placeholder#~2.0.7 not-cached git://github.com/mathiasbynens/jquery-placeholder.git#~2.0.7
bower jquery-placeholder#~2.0.7 resolve git://github.com/mathiasbynens/jquery-placeholder.git#~2.0.7
bower jquery.cookie#~1.4.0 not-cached git://github.com/carhartl/jquery-cookie.git#~1.4.0
bower jquery.cookie#~1.4.0 resolve git://github.com/carhartl/jquery-cookie.git#~1.4.0
bower fastclick#>=0.6.11 download https://github.com/ftlabs/fastclick/archive/v1.0.3.tar.gz
bower jquery-placeholder#~2.0.7 download https://github.com/mathiasbynens/jquery-placeholder/archive/v2.0.9.tar.gz
bower jquery.cookie#~1.4.0 download https://github.com/carhartl/jquery-cookie/archive/v1.4.1.tar.gz
bower modernizr#>= 2.7.2 download https://github.com/Modernizr/Modernizr/archive/v2.8.3.tar.gz
bower d3#* extract archive.tar.gz
bower jquery-placeholder#~2.0.7 extract archive.tar.gz
bower jquery.cookie#~1.4.0 extract archive.tar.gz
bower fastclick#>=0.6.11 extract archive.tar.gz
bower jquery-placeholder#~2.0.7 mismatch Version declared in the json (2.0.8) is different than the resolved one (2.0.9)
bower jquery-placeholder#~2.0.7 resolved git://github.com/mathiasbynens/jquery-placeholder.git#2.0.9
bower jquery.cookie#~1.4.0 resolved git://github.com/carhartl/jquery-cookie.git#1.4.1
bower fastclick#>=0.6.11 resolved git://github.com/ftlabs/fastclick.git#1.0.3
bower d3#* resolved git://github.com/mbostock/d3.git#3.5.3
bower modernizr#>= 2.7.2 extract archive.tar.gz
bower modernizr#>= 2.7.2 resolved git://github.com/Modernizr/Modernizr.git#2.8.3
bower moment#* install moment#2.8.4
bower angular-mocks#* install angular-mocks#1.3.8
bower angular#1.3.8 install angular#1.3.8
bower jquery#>= 2.1.0 install jquery#2.1.3
bower angular-route#* install angular-route#1.3.8
bower foundation#* install foundation#5.5.0
bower jquery-placeholder#~2.0.7 install jquery-placeholder#2.0.9
bower jquery.cookie#~1.4.0 install jquery.cookie#1.4.1
bower fastclick#>=0.6.11 install fastclick#1.0.3
bower d3#* install d3#3.5.3
bower modernizr#>= 2.7.2 install modernizr#2.8.3
-
moment#2.8.4 moment
angular-mocks#1.3.8 angular-mocks
└── angular#1.3.8
angular#1.3.8 angular
jquery#2.1.3 jquery
angular-route#1.3.8 angular-route
└── angular#1.3.8
foundation#5.5.0 foundation
├── fastclick#1.0.3
├── jquery#2.1.3
├── jquery-placeholder#2.0.9
├── jquery.cookie#1.4.1
└── modernizr#2.8.3
jquery-placeholder#2.0.9 jquery-placeholder
└── jquery#2.1.3
jquery.cookie#1.4.1 jquery.cookie
└── jquery#2.1.3
fastclick#1.0.3 fastclick
d3#3.5.3 d3
modernizr#2.8.3 modernizr
npm WARN engine [email protected]: wanted: {"node":"~0.8.x"} (current: {"node":"0.10.32","npm":"1.4.28"})
> [email protected] install /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/karma/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
SOLINK_MODULE(target) Release/fse.node: Finished
npm WARN engine [email protected]: wanted: {"node":"0.6.x || 0.8.x"} (current: {"node":"0.10.32","npm":"1.4.28"})
> [email protected] install /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js
Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-macosx.zip
Saving to /var/folders/lt/b4jv9_m56qx3v_n5mm1jqgbr0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip
Receiving...
[====================================----] 91% 0.0s
Received 9187K total.
Extracting zip contents
Removing /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Copying extracted folder /var/folders/lt/b4jv9_m56qx3v_n5mm1jqgbr0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip-extract-1420316830979/phantomjs-1.9.8-macosx -> /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Removing /var/folders/lt/b4jv9_m56qx3v_n5mm1jqgbr0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip-extract-1420316830979
Writing location.js file
Done. Phantomjs binary available at /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs
> [email protected] install /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/phantomas/node_modules/phantomjs
> node install.js
Download already available at /var/folders/lt/b4jv9_m56qx3v_n5mm1jqgbr0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip
Extracting zip contents
Removing /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/phantomas/node_modules/phantomjs/lib/phantom
Copying extracted folder /var/folders/lt/b4jv9_m56qx3v_n5mm1jqgbr0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip-extract-1420316831866/phantomjs-1.9.8-macosx -> /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/phantomas/node_modules/phantomjs/lib/phantom
Removing /var/folders/lt/b4jv9_m56qx3v_n5mm1jqgbr0000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip-extract-1420316831866
Writing location.js file
Done. Phantomjs binary available at /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/phantomas/node_modules/phantomjs/lib/phantom/bin/phantomjs
> [email protected] install /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
SOLINK_MODULE(target) Release/validation.node: Finished
npm ERR! peerinvalid The package karma-requirejs does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants karma-requirejs@~0.2.0
npm ERR! System Darwin 13.4.0
npm ERR! command "/Users/pk/.nvm/v0.10.32/bin/node" "/Users/pk/.nvm/v0.10.32/bin/npm" "install"
npm ERR! cwd /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/pk/Documents/dev/hapi-playground/generator-ghurt/client/npm-debug.log
npm ERR! not ok code 0
invoke ghurt:hapi
const server = Hapi.createServer('0.0.0.0', config.port, options);
^
TypeError: Hapi.createServer is not a function
at Object. (/srv/www/server/server.js:17:21)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
DEBUG: Program node server.js exited with code 1
DEBUG: Starting child process with 'node server.js'
/srv/www/server/server.js:17
const server = Hapi.createServer('0.0.0.0', config.port, options);
I'm getting the following warning when creating a new project using the hapi subgenerator: $ yo ghurt:hapi
bower ENOENT No bower.json present
Here's the full output (minus npm listings at the end):
$ yo ghurt:hapi
_-----_
| |
|--(o)--| .--------------------------.
`---------´ | Welcome to Yeoman, |
( _´U`_ ) | ladies and gentlemen! |
/___A___\ '__________________________'
| ~ |
__'.___.'__
´ ` |° ´ Y `
We need some information about your app to automagically create it...
[?] What is the name of your application? hey-bro
[?] Can you give us a brief description? nope
[?] What version is it on? 0.0.1
[?] Who is the author? Peter
[?] What is the home URL of the GIT repo?
[?] Under which license is it created? BSD
[?] Which port do you want your server to run on? 8001
[?] Do you want a quick install? Yes
create package.json
create .jshintrc
create gruntFile.js
create .gitignore
create config.js
create server.js
create src/api/index/indexRoutes.js
create src/api/util/logger.js
create src/error_messages/en_GB.json
invoke ghurt:hapi-util
create src/api/demo/getDemoCollection/getDemoCollection.js
create test/api/demo/getDemoCollection/getDemoCollection.spec.js
create src/api/demo/demoRoutes.js
force server.js
invoke ghurt:hapi-util
create src/api/demo/getDemoElement/getDemoElement.js
create test/api/demo/getDemoElement/getDemoElement.spec.js
force src/api/demo/demoRoutes.js
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm WARN package.json [email protected] No README data
bower ENOENT No bower.json present
And here is the generated directory structure (again, minus node_modules directory):
$ tree
.
├── config.js
├── gruntFile.js
├── package.json
├── server.js
├── src
│ ├── api
│ │ ├── demo
│ │ │ ├── demoRoutes.js
│ │ │ ├── getDemoCollection
│ │ │ │ └── getDemoCollection.js
│ │ │ └── getDemoElement
│ │ │ └── getDemoElement.js
│ │ ├── index
│ │ │ └── indexRoutes.js
│ │ └── util
│ │ └── logger.js
│ └── error_messages
│ └── en_GB.json
└── test
└── api
└── demo
├── getDemoCollection
│ └── getDemoCollection.spec.js
└── getDemoElement
└── getDemoElement.spec.js
13 directories, 12 files
should we give people the option as part of the build, to use grunt or gulp as their build system.
im wondering whether we should adhere to these for the client side of things
http://blog.angularjs.org/2014/02/an-angularjs-style-guide-and-best.html?m=1
https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub
This would change where our unit tests go and also how we name certain types of files.
They do work only on first install. Once you push the code and clone it from a different machine then they do not work.
They do not work outside OSX as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.