Angular: Difference between revisions
From charlesreid1
| Line 969: | Line 969: | ||
I ran into more snags trying to get this whole thing ironed out so that I could, uh, gee, ACTUALLY START ON MY PROJECT, 8 hours after setting out to get Angular.js built. | I ran into more snags trying to get this whole thing ironed out so that I could, uh, gee, ACTUALLY START ON MY PROJECT, 8 hours after setting out to get Angular.js built. | ||
==Problems with grunt serve== | |||
Grunt serve does not actually serve. It says it is hosting on localhost:9000, but it is not. | |||
I can't access that port remotely at the machine's IP, with <code>AA.BBB.CC.DD:9000</code>, nor can I see it if I tunnel all HTTP traffic through a local port on the remote machine and visit port 9000. '''It ain't open anywhere.''' | |||
Can't fix, don't understand, so I'm going to use Python. (I'm not even confident I know what language this is written in. Javascript??) | |||
This is turning into the same horrible experience that the "magical" Ruby environment presented. I have no freaking clue what any of these tools are doing, how they work, why they're breaking, or what the hell's going on. | |||
==Problems with JSHint== | ==Problems with JSHint== | ||
Revision as of 15:24, 30 March 2015
Installing: First Try
The first try with node.js from aptitude: Angular/FirstTry
Installing: Second Try
This documentation is worthless.
The second try with node from aptitude: Angular/SecondTry
Installing: Third Try (Works)
The third try, installing node with nvm:
Install node with nvm
Use nvm
git clone https://github.com/creationix/nvm.git ~/.nvm echo "source ~/.nvm/nvm.sh" >> .bashrc nvm ls-remote nvm install -s v0.11.16 nvm alias default 0.11.16
test:
node -v && npm -v
Install grunt and bower
Now install grunt and bower:
npm install -g grunt-cli npm install -g bower
but this time, when you need to use them, use the link command [1]:
npm link grunt-cli npm link bower
Get Angular
$ git clone https://github.com/angular/angular.js
Build Angular
Change dir and link to node modules:
cd angular.js/
First, link grunt
npm link grunt-cli
which returns:
$ npm link grunt-cli unbuild grunt-cli@0.1.13 npm WARN prefer global grunt-cli@0.1.13 should be installed with -g /home/charles/codes/angular.js/node_modules/grunt-cli -> /home/charles/.nvm/v0.11.16/lib/node_modules/grunt-cli
I DID install grunt-cli with -g. Don't know what this thing is talking about.
Next, bower:
npm link bower
and the same damn error:
$ npm link bower npm WARN prefer global bower@1.3.12 should be installed with -g /home/charles/codes/angular.js/node_modules/bower -> /home/charles/.nvm/v0.11.16/lib/node_modules/bower
Build/Install/Package
Now the last three commands:
npm install bower install grunt package
npm install
First:
$ npm install
npm WARN engine karma@0.12.32: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN optional dep failed, continuing fsevents@0.3.5
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN optional dep failed, continuing fsevents@0.2.1
> ws@0.5.0 install /home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
> ws@0.4.31 install /home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
make: Leaving directory `/home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'
npm WARN engine bootstrap@3.3.2: wanted: {"node":"~0.10.1"} (current: {"node":"0.11.16","npm":"2.3.0"})
> utf-8-validate@1.0.1 install /home/charles/codes/angular.js/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild
|
okay! it worked!
bower install
next:
$ bower install bower ng-closure-runner#* cached https://raw.github.com/angular/ng-closure-runner/v0.2.3/assets/ng-closure-runner.zip#e-tag:91da43ccc bower ng-closure-runner#* validate e-tag:91da43ccc against https://raw.github.com/angular/ng-closure-runner/v0.2.3/assets/ng-closure-runner.zip#* bower closure-compiler#* cached https://dl.google.com/closure-compiler/compiler-20140814.zip#e-tag:469db bower closure-compiler#* validate e-tag:469db against https://dl.google.com/closure-compiler/compiler-20140814.zip#* bower jquery#2.1.1 cached git://github.com/jquery/jquery.git#2.1.1 bower jquery#2.1.1 validate 2.1.1 against git://github.com/jquery/jquery.git#2.1.1 bower closure-compiler#* install closure-compiler#e-tag:469db bower jquery#2.1.1 install jquery#2.1.1 bower ng-closure-runner#* install ng-closure-runner#e-tag:91da43ccc closure-compiler#e-tag:469db bower_components/closure-compiler jquery#2.1.1 bower_components/jquery ng-closure-runner#e-tag:91da43ccc bower_components/ng-closure-runner
worked!
grunt package
okay, last but not least, the step that keeps failing:
$ grunt package
Running "shell:npm-install" (shell) task
diff: node_modules/npm-shrinkwrap.cached.json: No such file or directory
Blowing away node_modules and reinstalling npm dependencies...
npm WARN engine karma@0.12.32: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN optional dep failed, continuing fsevents@0.3.5
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm ERR! Linux 3.13.0-36-generic
npm ERR! argv "/home/charles/.nvm/v0.11.16/bin/node" "/home/charles/.nvm/v0.11.16/bin/npm" "install"
npm ERR! node v0.11.16
npm ERR! npm v2.3.0
npm ERR! code ENOMEM
npm ERR! errno ENOMEM
npm ERR! syscall spawn
npm ERR! spawn ENOMEM
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <http://github.com/npm/npm/issues>
> ws@0.5.0 install /home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
Fatal error: read ECONNRESET
|
Solution: add an empty .npmignore file, so it doesn't try and use .gitignore instead.
Hat tip to Stack Overflow as usual.
$ grunt package
Running "shell:npm-install" (shell) task
diff: node_modules/npm-shrinkwrap.cached.json: No such file or directory
Blowing away node_modules and reinstalling npm dependencies...
npm WARN engine karma@0.12.32: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN optional dep failed, continuing fsevents@0.3.5
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN optional dep failed, continuing fsevents@0.2.1
> ws@0.5.0 install /home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: Leaving directory `/home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build'
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.11.16","npm":"2.3.0"})
> ws@0.4.31 install /home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
make: Leaving directory `/home/charles/codes/angular.js/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'
npm WARN engine bootstrap@3.3.2: wanted: {"node":"~0.10.1"} (current: {"node":"0.11.16","npm":"2.3.0"})
> utf-8-validate@1.0.1 install /home/charles/codes/angular.js/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/home/charles/codes/angular.js/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: Leaving directory `/home/charles/codes/angular.js/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/utf-8-validate/build'
> bufferutil@1.0.1 install /home/charles/codes/angular.js/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/home/charles/codes/angular.js/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/bufferutil/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
make: Leaving directory `/home/charles/codes/angular.js/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/bufferutil/build'
karma-chrome-launcher@0.1.5 node_modules/karma-chrome-launcher
sorted-object@1.0.0 node_modules/sorted-object
karma-script-launcher@0.1.0 node_modules/karma-script-launcher
karma-firefox-launcher@0.1.3 node_modules/karma-firefox-launcher
canonical-path@0.0.2 node_modules/canonical-path
node-html-encoder@0.0.2 node_modules/node-html-encoder
stringmap@0.2.2 node_modules/stringmap
grunt-merge-conflict@0.0.2 node_modules/grunt-merge-conflict
grunt-jasmine-node@0.1.0 node_modules/grunt-jasmine-node
gulp-rename@1.2.0 node_modules/gulp-rename
rewire@2.1.5 node_modules/rewire
karma-jasmine@0.1.5 node_modules/karma-jasmine
q@1.0.1 node_modules/q
marked@0.3.3 node_modules/marked
karma-junit-reporter@0.2.2 node_modules/karma-junit-reporter
└── xmlbuilder@0.4.2
grunt-contrib-clean@0.6.0 node_modules/grunt-contrib-clean
└── rimraf@2.2.8
semver@4.0.3 node_modules/semver
shelljs@0.3.0 node_modules/shelljs
grunt-shell@1.1.1 node_modules/grunt-shell
└── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
grunt-contrib-copy@0.6.0 node_modules/grunt-contrib-copy
└── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
benchmark@1.0.0 node_modules/benchmark
event-stream@3.1.7 node_modules/event-stream
├── stream-combiner@0.0.4
├── duplexer@0.1.1
├── from@0.1.3
├── pause-stream@0.0.11
├── map-stream@0.1.0
├── split@0.2.10
└── through@2.3.6
jshint-stylish@1.0.0 node_modules/jshint-stylish
├── log-symbols@1.0.1
├── text-table@0.2.0
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
└── string-length@1.0.0 (strip-ansi@2.0.1)
karma-browserstack-launcher@0.1.2 node_modules/karma-browserstack-launcher
├── browserstack@1.0.1
└── q@0.9.7
grunt-bump@0.0.17 node_modules/grunt-bump
└── semver@2.3.2
gulp-sourcemaps@1.3.0 node_modules/gulp-sourcemaps
├── convert-source-map@0.4.1
├── vinyl@0.4.6 (clone-stats@0.0.1, clone@0.2.0)
└── through2@0.6.3 (xtend@4.0.0, readable-stream@1.0.33)
gulp-util@3.0.3 node_modules/gulp-util
├── array-differ@1.0.0
├── beeper@1.0.0
├── object-assign@2.0.0
├── array-uniq@1.0.2
├── replace-ext@0.0.1
├── minimist@1.1.0
├── lodash.reescape@3.0.1 (lodash._reescape@3.0.0)
├── lodash.reinterpolate@3.0.1 (lodash._reinterpolate@3.0.0)
├── lodash.reevaluate@3.0.1 (lodash._reevaluate@3.0.0)
├── vinyl@0.4.6 (clone-stats@0.0.1, clone@0.2.0)
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── lodash.template@3.3.0 (lodash._reinterpolate@3.0.0, lodash._basetostring@3.0.0, lodash._basecopy@3.0.0, lodash._basevalues@3.0.0, lodash.templatesettings@3.1.0, lodash.escape@3.0.0, lodash._isiterateecall@3.0.2, lodash.keys@3.0.3)
├── through2@0.6.3 (xtend@4.0.0, readable-stream@1.0.33)
├── dateformat@1.0.11 (get-stdin@4.0.1, meow@3.0.0)
└── multipipe@0.1.2 (duplexer2@0.0.2)
karma-ng-scenario@0.1.0 node_modules/karma-ng-scenario
qq@0.3.5 node_modules/qq
└── q@0.8.4
load-grunt-tasks@0.6.0 node_modules/load-grunt-tasks
├── multimatch@0.3.0 (array-differ@0.1.0, array-union@0.1.0, minimatch@0.3.0)
└── findup-sync@0.1.3 (glob@3.2.11)
lodash@2.4.1 node_modules/lodash
gulp-concat@2.5.1 node_modules/gulp-concat
├── through2@0.6.3 (xtend@4.0.0, readable-stream@1.0.33)
└── concat-with-sourcemaps@1.0.0 (source-map@0.1.43)
gulp-foreach@0.0.1 node_modules/gulp-foreach
├── through@2.3.6
└── gulp-util@2.2.20 (lodash._reinterpolate@2.4.1, minimist@0.2.0, chalk@0.5.1, vinyl@0.2.3, lodash.template@2.4.1, through2@0.5.1, dateformat@1.0.11, multipipe@0.1.2)
grunt-contrib-compress@0.12.0 node_modules/grunt-contrib-compress
├── prettysize@0.0.3
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
└── archiver@0.11.0 (buffer-crc32@0.2.5, lazystream@0.1.0, async@0.9.0, readable-stream@1.0.33, zip-stream@0.4.1, glob@3.2.11, tar-stream@0.4.7)
q-io@1.11.6 node_modules/q-io
├── mimeparse@0.1.4
├── url2@0.0.0
├── mime@1.3.4
├── qs@1.2.2
└── collections@0.2.2 (weak-map@1.0.0)
browserstacktunnel-wrapper@1.3.1 node_modules/browserstacktunnel-wrapper
└── unzip@0.1.11 (setimmediate@1.0.2, pullstream@0.4.1, readable-stream@1.0.33, match-stream@0.0.2, fstream@0.1.31, binary@0.3.0)
grunt-ddescribe-iit@0.0.6 node_modules/grunt-ddescribe-iit
├── win-spawn@2.0.0
└── bluebird@2.9.12
cheerio@0.17.0 node_modules/cheerio
├── dom-serializer@0.0.1 (domelementtype@1.1.3)
├── entities@1.1.1
├── htmlparser2@3.7.3 (domelementtype@1.1.3, domutils@1.5.1, entities@1.0.0, domhandler@2.2.1, readable-stream@1.1.13)
└── CSSselect@0.4.1 (domutils@1.4.3, CSSwhat@0.4.7)
gulp-uglify@1.1.0 node_modules/gulp-uglify
├── deepmerge@0.2.7
├── through2@0.6.3 (xtend@4.0.0, readable-stream@1.0.33)
├── vinyl-sourcemaps-apply@0.1.4 (source-map@0.1.43)
└── uglify-js@2.4.16 (uglify-to-browserify@1.0.2, async@0.2.10, optimist@0.3.7, source-map@0.1.34)
jasmine-reporters@1.0.1 node_modules/jasmine-reporters
└── mkdirp@0.3.5
gulp@3.8.11 node_modules/gulp
├── v8flags@2.0.2
├── pretty-hrtime@0.2.2
├── interpret@0.3.10
├── deprecated@0.0.1
├── archy@1.0.0
├── minimist@1.1.0
├── tildify@1.0.0 (user-home@1.1.1)
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
├── semver@4.3.0
├── orchestrator@0.3.7 (stream-consume@0.1.0, sequencify@0.0.7, end-of-stream@0.1.5)
├── liftoff@2.0.1 (extend@1.3.0, flagged-respawn@0.3.1, resolve@1.0.0, findup-sync@0.2.1)
└── vinyl-fs@0.3.13 (graceful-fs@3.0.5, strip-bom@1.0.0, defaults@1.0.0, vinyl@0.4.6, mkdirp@0.5.0, through2@0.6.3, glob-stream@3.1.18, glob-watcher@0.0.6)
grunt-contrib-connect@0.8.0 node_modules/grunt-contrib-connect
├── connect-livereload@0.4.1
├── open@0.0.5
├── async@0.9.0
├── portscanner@0.2.3 (async@0.1.15)
└── connect@2.19.6 (parseurl@1.0.1, response-time@2.0.0, cookie@0.1.2, escape-html@1.0.1, pause@0.0.1, cookie-signature@1.0.3, vhost@1.0.0, fresh@0.2.2, qs@0.6.6, on-headers@0.0.0, basic-auth-connect@1.0.0, bytes@1.0.0, serve-favicon@2.0.1, morgan@1.1.1, errorhandler@1.0.2, cookie-parser@1.1.0, connect-timeout@1.1.0, body-parser@1.3.1, method-override@2.0.2, debug@1.0.2, express-session@1.2.1, csurf@1.2.1, type-is@1.2.1, multiparty@3.2.8, compression@1.0.7, serve-static@1.2.3, serve-index@1.1.1)
jasmine-node@1.14.5 node_modules/jasmine-node
├── mkdirp@0.3.5
├── underscore@1.8.1
├── walkdir@0.0.7
├── jasmine-growl-reporter@0.0.3 (growl@1.7.0)
├── coffee-script@1.9.1
├── requirejs@2.1.16
└── gaze@0.3.4 (minimatch@0.2.14, fileset@0.1.5)
promises-aplus-tests@2.1.0 node_modules/promises-aplus-tests
├── underscore@1.6.0
├── mocha@1.21.5 (escape-string-regexp@1.0.2, diff@1.0.8, growl@1.8.1, commander@2.3.0, debug@2.0.0, mkdirp@0.5.0, glob@3.2.3, jade@0.26.3)
└── sinon@1.12.2 (lolex@1.1.0, util@0.10.3, formatio@1.1.1)
gulp-jshint@1.4.2 node_modules/gulp-jshint
├── map-stream@0.1.0
├── lodash.clone@2.4.1 (lodash._baseclone@2.4.1, lodash._basecreatecallback@2.4.1)
├── gulp-util@2.2.20 (lodash._reinterpolate@2.4.1, minimist@0.2.0, chalk@0.5.1, vinyl@0.2.3, lodash.template@2.4.1, through2@0.5.1, dateformat@1.0.11, multipipe@0.1.2)
└── jshint@2.4.4 (console-browserify@0.1.6, exit@0.1.2, underscore@1.4.4, minimatch@0.4.0, shelljs@0.1.4, htmlparser2@3.3.0, cli@0.4.5)
grunt@0.4.5 node_modules/grunt
├── which@1.0.8
├── dateformat@1.0.2-1.2.3
├── eventemitter2@0.4.14
├── getobject@0.1.0
├── rimraf@2.2.8
├── colors@0.6.2
├── async@0.1.22
├── grunt-legacy-util@0.2.0
├── hooker@0.2.3
├── exit@0.1.2
├── nopt@1.0.10 (abbrev@1.0.5)
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3)
├── lodash@0.9.2
├── coffee-script@1.3.3
├── underscore.string@2.2.1
├── iconv-lite@0.2.11
├── js-yaml@2.0.5 (argparse@0.1.16, esprima@1.0.4)
├── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1)
└── grunt-legacy-log@0.1.1 (underscore.string@2.3.3, lodash@2.4.1)
dgeni@0.4.1 node_modules/dgeni
├── di@0.0.1
├── q@0.9.7
├── optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10)
├── dependency-graph@0.1.0 (underscore@1.4.4)
├── validate.js@0.2.0
└── winston@0.7.3 (cycle@1.0.3, stack-trace@0.0.9, eyes@0.1.8, colors@0.6.2, async@0.2.10, pkginfo@0.3.0, request@2.16.6)
dgeni-packages@0.10.10 node_modules/dgeni-packages
├── estraverse@1.9.1
├── change-case@2.2.0 (snake-case@1.1.1, dot-case@1.1.1, title-case@1.1.0, param-case@1.1.1, upper-case-first@1.1.0, pascal-case@1.1.0, constant-case@1.1.0, path-case@1.1.1, is-upper-case@1.1.1, camel-case@1.1.1, is-lower-case@1.1.1, swap-case@1.1.0, upper-case@1.1.2, lower-case@1.1.2, sentence-case@1.1.2)
├── catharsis@0.7.1
├── minimatch@0.3.0 (sigmund@1.0.0, lru-cache@2.5.0)
├── glob@3.2.11 (inherits@2.0.1)
├── htmlparser2@3.8.2 (domelementtype@1.1.3, entities@1.0.0, domhandler@2.3.0, readable-stream@1.1.13, domutils@1.5.1)
├── esprima@1.2.4
├── q-io@1.10.9 (mimeparse@0.1.4, url2@0.0.0, mime@1.2.11, q@0.9.7, qs@0.1.0, collections@0.2.2)
├── nunjucks@1.0.7 (chokidar@0.8.4, optimist@0.6.1)
└── winston@0.7.3 (cycle@1.0.3, stack-trace@0.0.9, eyes@0.1.8, colors@0.6.2, async@0.2.10, pkginfo@0.3.0, request@2.16.6)
grunt-contrib-jshint@0.10.0 node_modules/grunt-contrib-jshint
├── hooker@0.2.3
└── jshint@2.5.11 (strip-json-comments@1.0.2, underscore@1.6.0, exit@0.1.2, console-browserify@1.1.0, minimatch@1.0.0, cli@0.6.5, htmlparser2@3.8.2)
karma@0.12.32 node_modules/karma
├── di@0.0.1
├── graceful-fs@2.0.3
├── rimraf@2.2.8
├── colors@0.6.2
├── mime@1.2.11
├── q@0.9.7
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
├── optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10)
├── source-map@0.1.43 (amdefine@0.1.0)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
├── expand-braces@0.1.1 (array-uniq@1.0.2, array-slice@0.2.2, braces@0.1.5)
├── chokidar@1.0.0-rc3 (async-each@0.1.6, is-binary-path@1.0.0, glob-parent@1.0.0, anymatch@1.1.0, readdirp@1.3.0)
├── log4js@0.6.22 (semver@1.1.4, async@0.2.10, readable-stream@1.0.33)
├── http-proxy@0.10.4 (pkginfo@0.3.0, utile@0.2.1)
├── connect@2.26.6 (cookie@0.1.2, pause@0.0.1, fresh@0.2.4, cookie-signature@1.0.5, response-time@2.0.1, basic-auth-connect@1.0.0, vhost@3.0.0, bytes@1.0.0, on-headers@1.0.0, media-typer@0.3.0, parseurl@1.3.0, depd@0.4.5, qs@2.2.4, connect-timeout@1.3.0, debug@2.0.0, finalhandler@0.2.0, cookie-parser@1.3.4, method-override@2.2.0, morgan@1.3.2, csurf@1.6.6, serve-favicon@2.1.7, express-session@1.8.2, serve-static@1.6.5, type-is@1.5.7, errorhandler@1.2.4, compression@1.1.2, multiparty@3.3.2, body-parser@1.8.4, serve-index@1.2.1)
├── useragent@2.0.10 (lru-cache@2.2.4)
├── socket.io@1.3.4 (debug@2.1.0, has-binary-data@0.1.3, socket.io-parser@2.2.3, socket.io-adapter@0.3.1, engine.io@1.5.1, socket.io-client@1.3.4)
└── memoizee@0.3.8 (next-tick@0.2.2, lru-queue@0.1.0, timers-ext@0.1.0, d@0.1.1, event-emitter@0.3.3, es6-weak-map@0.1.2, es5-ext@0.10.6)
grunt-jscs@1.2.0 node_modules/grunt-jscs
├── vow@0.4.8
├── hooker@0.2.3
└── jscs@1.10.0 (supports-color@1.2.0, strip-json-comments@1.0.2, commander@2.5.1, estraverse@1.9.1, exit@0.1.2, colors@1.0.3, vow-fs@0.3.4, minimatch@2.0.1, esprima-harmony-jscs@1.1.0-regex-token-fix, esprima@1.2.4, glob@4.0.6, xmlbuilder@2.4.6)
bower@1.3.12 node_modules/bower
├── is-root@1.0.0
├── junk@1.0.0
├── stringify-object@1.0.0
├── which@1.0.8
├── abbrev@1.0.5
├── chmodr@0.1.0
├── osenv@0.1.0
├── archy@0.0.2
├── rimraf@2.2.8
├── opn@1.0.1
├── lru-cache@2.5.0
├── bower-logger@0.2.2
├── bower-endpoint-parser@0.2.2
├── graceful-fs@3.0.5
├── lockfile@1.0.0
├── nopt@3.0.1
├── retry@0.6.0
├── tmp@0.0.23
├── request-progress@0.3.0 (throttleit@0.0.2)
├── chalk@0.5.0 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
├── semver@2.3.2
├── shell-quote@1.4.2 (array-filter@0.0.1, array-map@0.0.0, array-reduce@0.0.0, jsonify@0.0.0)
├── bower-json@0.4.0 (intersect@0.0.3, deep-extend@0.2.11, graceful-fs@2.0.3)
├── fstream@1.0.4 (inherits@2.0.1)
├── promptly@0.2.0 (read@1.0.5)
├── mkdirp@0.5.0 (minimist@0.0.8)
├── p-throttler@0.1.0 (q@0.9.7)
├── bower-config@0.5.2 (osenv@0.0.3, graceful-fs@2.0.3, optimist@0.6.1)
├── fstream-ignore@1.0.2 (inherits@2.0.1, minimatch@2.0.1)
├── tar-fs@0.5.2 (pump@0.3.5, tar-stream@0.4.7)
├── decompress-zip@0.0.8 (nopt@2.2.1, mkpath@0.1.0, touch@0.0.2, readable-stream@1.1.13, binary@0.3.0)
├── glob@4.0.6 (inherits@2.0.1, once@1.3.1, minimatch@1.0.0)
├── request@2.42.0 (caseless@0.6.0, json-stringify-safe@5.0.0, forever-agent@0.5.2, aws-sign2@0.5.0, stringstream@0.0.4, oauth-sign@0.4.0, tunnel-agent@0.4.0, qs@1.2.2, node-uuid@1.4.2, mime-types@1.0.2, form-data@0.1.4, tough-cookie@0.12.1, bl@0.9.4, http-signature@0.10.1, hawk@1.1.1)
├── bower-registry-client@0.2.3 (graceful-fs@2.0.3, request-replay@0.2.0, lru-cache@2.3.1, async@0.2.10, mkdirp@0.3.5, request@2.51.0)
├── mout@0.9.1
├── cardinal@0.4.0 (redeyed@0.4.4)
├── handlebars@2.0.0 (optimist@0.3.7, uglify-js@2.3.6)
├── update-notifier@0.2.0 (semver-diff@0.1.0, string-length@0.1.2, latest-version@0.2.0, configstore@0.3.2)
├── inquirer@0.7.1 (figures@1.3.5, mute-stream@0.0.4, through@2.3.6, readline2@0.1.1, rx@2.4.0, cli-color@0.3.2)
└── insight@0.4.3 (object-assign@1.0.0, async@0.9.0, chalk@0.5.1, lodash.debounce@2.4.1, os-name@1.0.3, tough-cookie@0.12.1, configstore@0.3.2, inquirer@0.6.0)
karma-sauce-launcher@0.2.10 node_modules/karma-sauce-launcher
├── saucelabs@0.1.1
├── q@0.9.7
├── wd@0.3.11 (vargs@0.1.0, async@0.9.0, q@1.0.1, underscore.string@2.3.3, request@2.46.0, archiver@0.12.0)
└── sauce-connect-launcher@0.6.1 (rimraf@2.2.8, async@0.9.0, adm-zip@0.4.7)
angular-benchpress@0.2.2 node_modules/angular-benchpress
├── rimraf@2.2.8
├── minimist@1.1.0
├── underscore@1.8.1
├── mkdirp@0.5.0 (minimist@0.0.8)
├── express@4.11.2 (utils-merge@1.0.0, merge-descriptors@0.0.2, methods@1.1.1, fresh@0.2.4, cookie@0.1.2, escape-html@1.0.1, range-parser@1.0.2, cookie-signature@1.0.5, finalhandler@0.3.3, vary@1.0.0, media-typer@0.3.0, parseurl@1.3.0, serve-static@1.8.1, content-disposition@0.5.0, path-to-regexp@0.1.3, depd@1.0.0, qs@2.3.3, on-finished@2.2.0, debug@2.1.1, proxy-addr@1.0.6, etag@1.5.1, send@0.11.1, type-is@1.5.7, accepts@1.2.4)
├── rx@2.3.25
├── di@2.0.0-pre-9 (es6-shim@0.9.3, traceur@0.0.33)
├── browserify@7.0.3 (https-browserify@0.0.0, tty-browserify@0.0.0, builtins@0.0.7, constants-browserify@0.0.1, path-browserify@0.0.0, isarray@0.0.1, process@0.8.0, inherits@2.0.1, os-browserify@0.1.2, string_decoder@0.10.31, commondir@0.0.1, stream-browserify@1.0.0, defined@0.0.0, shell-quote@0.0.1, subarg@1.0.0, domain-browser@1.1.4, xtend@3.0.0, shallow-copy@0.0.1, deep-equal@0.2.2, assert@1.1.2, querystring-es3@0.2.1, punycode@1.2.4, util@0.10.3, events@1.0.2, parents@0.0.3, timers-browserify@1.3.0, vm-browserify@0.0.4, console-browserify@1.1.0, url@0.10.2, http-browserify@1.7.0, readable-stream@1.0.33, buffer@2.8.2, resolve@0.7.4, deps-sort@1.3.5, shasum@1.0.1, through2@1.1.1, duplexer2@0.0.2, concat-stream@1.4.7, JSONStream@0.8.4, glob@4.4.0, labeled-stream-splicer@1.0.2, browser-resolve@1.7.0, crypto-browserify@3.9.12, browser-pack@3.2.0, umd@2.1.0, insert-module-globals@6.2.0, syntax-error@1.1.2, module-deps@3.7.2, browserify-zlib@0.1.4)
└── bootstrap@3.3.2
protractor@2.0.0 node_modules/protractor
├── jasminewd@1.1.0
├── jasminewd2@0.0.3
├── saucelabs@0.1.1
├── html-entities@1.1.2
├── q@1.0.0
├── minijasminenode@1.1.1
├── adm-zip@0.4.4
├── optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10)
├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)
├── accessibility-developer-tools@2.6.0
├── source-map-support@0.2.10 (source-map@0.1.32)
├── request@2.36.0 (json-stringify-safe@5.0.0, forever-agent@0.5.2, aws-sign2@0.5.0, qs@0.6.6, oauth-sign@0.3.0, tunnel-agent@0.4.0, mime@1.2.11, node-uuid@1.4.3, form-data@0.1.4, tough-cookie@0.12.1, http-signature@0.10.1, hawk@1.0.0)
├── jasmine@2.1.1 (jasmine-core@2.1.3)
└── selenium-webdriver@2.45.1 (tmp@0.0.24, rimraf@2.3.2, xml2js@0.4.4, ws@0.7.1)
npm install successful!
Running "bower" task
Running "clean:build" (clean) task
>> 0 paths cleaned.
Running "clean:tmp" (clean) task
>> 0 paths cleaned.
Running "buildall" task
>> File build/angular-scenario.js created.
>> File build/angular.js created.
>> File build/angular-loader.js created.
>> File build/angular-touch.js created.
>> File build/angular-mocks.js created.
>> File build/angular-sanitize.js created.
>> File build/angular-resource.js created.
>> File build/angular-messageFormat.js created.
>> File build/angular-messages.js created.
>> File build/angular-animate.js created.
>> File build/angular-route.js created.
>> File build/angular-cookies.js created.
>> File build/angular-aria.js created.
>> File tmp/promises-aplus-adapter++.js created.
Running "minall" task
>> build/angular-cookies.js minified into build/angular-cookies.min.js
>> build/angular-loader.js minified into build/angular-loader.min.js
>> build/angular-messages.js minified into build/angular-messages.min.js
>> build/angular-resource.js minified into build/angular-resource.min.js
>> build/angular-touch.js minified into build/angular-touch.min.js
>> build/angular-route.js minified into build/angular-route.min.js
>> build/angular-sanitize.js minified into build/angular-sanitize.min.js
>> build/angular-aria.js minified into build/angular-aria.min.js
>> build/angular-messageFormat.js minified into build/angular-messageFormat.min.js
>> build/angular-animate.js minified into build/angular-animate.min.js
build/angular.js:4335: WARNING - Throw expression is not a minErr instance.
throw err;
^
build/angular.js:10037: WARNING - Throw expression is not a minErr instance.
throw e;
^
build/angular.js:11558: WARNING - Throw expression is not a minErr instance.
throw e;
^
build/angular.js:15403: WARNING - Throw expression is not a minErr instance.
throw e;
^
0 error(s), 4 warning(s)
>> build/angular.js minified into build/angular.min.js
Running "collect-errors" task
Running "docs" task
[00:01:23] Working directory changed to ~/codes/angular.js/docs
[00:01:25] Using gulpfile ~/codes/angular.js/docs/gulpfile.js
[00:01:25] Starting 'bower'...
[00:01:25] Starting 'build-app'...
[00:01:27] bower: cached jquery
[00:01:27] bower: validate jquery
[00:01:28] Finished 'build-app' after 3.08 s
[00:01:29] bower: not-cached open-sans-fontface
[00:01:29] bower: resolve open-sans-fontface
[00:01:29] bower: not-cached bootstrap
[00:01:29] bower: resolve bootstrap
[00:01:29] bower: not-cached google-code-prettify
[00:01:29] bower: resolve google-code-prettify
[00:01:29] bower: not-cached lunr.js
[00:01:29] bower: resolve lunr.js
[00:01:29] bower: download open-sans-fontface
[00:01:29] bower: download google-code-prettify
[00:01:29] bower: download lunr.js
[00:01:29] bower: download bootstrap
[00:01:30] bower: extract lunr.js
[00:01:31] bower: mismatch lunr.js
[00:01:31] bower: resolved lunr.js
[00:01:32] bower: extract open-sans-fontface
[00:01:32] bower: extract bootstrap
[00:01:32] bower: resolved open-sans-fontface
[00:01:33] bower: extract google-code-prettify
[00:01:33] bower: resolved bootstrap
[00:01:34] bower: resolved google-code-prettify
[00:01:34] bower: install jquery
[00:01:34] bower: install lunr.js
[00:01:34] bower: install open-sans-fontface
[00:01:34] bower: install bootstrap
[00:01:34] bower: install google-code-prettify
[00:01:35] Finished 'bower' after 9.77 s
[00:01:35] Starting 'assets'...
[00:01:35] Starting 'doc-gen'...
info: running processor: readFilesProcessor
info: running processor: extractJSDocCommentsProcessor
info: running processor: parseExamplesProcessor
info: running processor: parseTagsProcessor
info: running processor: filterNgDocsProcessor
info: running processor: extractTagsProcessor
info: running processor: codeNameProcessor
info: running processor: generateExamplesProcessor
info: running processor: generateProtractorTestsProcessor
info: running processor: errorDocsProcessor
info: running processor: generateIndexPagesProcessor
info: running processor: computeIdsProcessor
info: running processor: memberDocsProcessor
info: running processor: moduleDocsProcessor
info: running processor: generateComponentGroupsProcessor
info: running processor: providerDocsProcessor
info: running processor: computePathsProcessor
info: running processor: generateKeywordsProcessor
info: running processor: generatePagesDataProcessor
info: running processor: generateVersionDocProcessor
info: running processor: renderDocsProcessor
info: running processor: unescapeCommentsProcessor
info: running processor: inlineTagProcessor
info: running processor: writeFilesProcessor
info: running processor: checkAnchorLinksProcessor
[00:02:15] Finished 'doc-gen' after 40 s
[00:02:15] Starting 'jshint'...
[00:02:15] Finished 'jshint' after 216 ms
[00:02:21] Finished 'assets' after 46 s
[00:02:21] Starting 'default'...
[00:02:21] Finished 'default' after 28 μs
Running "copy:i18n" (copy) task
Created 1 directories, copied 743 files
Running "write:versionTXT" (write) task
>> wrote to build/version.txt
Running "write:versionJSON" (write) task
>> wrote to build/version.json
Running "compress:build" (compress) task
Created build/angular-1.4.0-local+sha.73f3515.zip (9760469 bytes)
Done, without errors.
|
woo hoo! It worked!
Getting Started
To get started with an angular app, you can either start with the angular-seed repository: https://github.com/angular/angular-seed
Or you can use Yeoman to get a template angular app up and running.
A Simple Tutorial
The Angular site has a simple tutorial that builds up complexity to a complete webapp that is a phone gallery:
https://docs.angularjs.org/tutorial/
Yeoman
First, install yeoman using npm:
npm install -g yo bower grunt-cli gulp
This raised some issues:
$ npm install -g yo bower grunt-cli gulp
/home/charles/.nvm/v0.11.16/bin/gulp -> /home/charles/.nvm/v0.11.16/lib/node_modules/gulp/bin/gulp.js
/home/charles/.nvm/v0.11.16/bin/grunt -> /home/charles/.nvm/v0.11.16/lib/node_modules/grunt-cli/bin/grunt
/home/charles/.nvm/v0.11.16/bin/yo -> /home/charles/.nvm/v0.11.16/lib/node_modules/yo/lib/cli.js
> yo@1.4.6 postinstall /home/charles/.nvm/v0.11.16/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
/home/charles/.nvm/v0.11.16/bin/bower -> /home/charles/.nvm/v0.11.16/lib/node_modules/bower/bin/bower
✖
npm root value is not in your NODE_PATH
[Info]
NODE_PATH = /usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
npm root = /home/charles/.nvm/v0.11.16/lib/node_modules
[Fix] Append the npm root value to your NODE_PATH variable
Add this line to your .bashrc
export NODE_PATH=$NODE_PATH:/home/charles/.nvm/v0.11.16/lib/node_modules
Or run this command
echo "export NODE_PATH=$NODE_PATH:/home/charles/.nvm/v0.11.16/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
Found potential issues on your machine :(
gulp@3.8.11 /home/charles/.nvm/v0.11.16/lib/node_modules/gulp
├── v8flags@2.0.2
├── pretty-hrtime@0.2.2
├── interpret@0.3.10
├── deprecated@0.0.1
├── archy@1.0.0
├── tildify@1.0.0 (user-home@1.1.1)
├── minimist@1.1.1
├── chalk@0.5.1 (ansi-styles@1.1.0, escape-string-regexp@1.0.3, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── orchestrator@0.3.7 (stream-consume@0.1.0, sequencify@0.0.7, end-of-stream@0.1.5)
├── semver@4.3.3
├── gulp-util@3.0.4 (array-differ@1.0.0, object-assign@2.0.0, beeper@1.0.0, array-uniq@1.0.2, lodash._reevaluate@3.0.0, lodash._reescape@3.0.0, lodash._reinterpolate@3.0.0, replace-ext@0.0.1, vinyl@0.4.6, chalk@1.0.0, lodash.template@3.4.0, through2@0.6.3, dateformat@1.0.11, multipipe@0.1.2)
├── liftoff@2.0.2 (extend@2.0.0, flagged-respawn@0.3.1, resolve@1.1.6, findup-sync@0.2.1)
└── vinyl-fs@0.3.13 (graceful-fs@3.0.6, strip-bom@1.0.0, defaults@1.0.2, vinyl@0.4.6, mkdirp@0.5.0, through2@0.6.3, glob-stream@3.1.18, glob-watcher@0.0.6)
grunt-cli@0.1.13 /home/charles/.nvm/v0.11.16/lib/node_modules/grunt-cli
├── nopt@1.0.10 (abbrev@1.0.5)
├── resolve@0.3.1
└── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1)
bower@1.3.12 /home/charles/.nvm/v0.11.16/lib/node_modules/bower
├── is-root@1.0.0
├── junk@1.0.1
├── stringify-object@1.0.1
├── which@1.0.9
├── abbrev@1.0.5
├── chmodr@0.1.0
├── osenv@0.1.0
├── archy@0.0.2
├── opn@1.0.1
├── rimraf@2.2.8
├── lru-cache@2.5.0
├── bower-logger@0.2.2
├── bower-endpoint-parser@0.2.2
├── graceful-fs@3.0.6
├── lockfile@1.0.0
├── nopt@3.0.1
├── retry@0.6.0
├── tmp@0.0.23
├── request-progress@0.3.0 (throttleit@0.0.2)
├── chalk@0.5.0 (ansi-styles@1.1.0, escape-string-regexp@1.0.3, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
├── q@1.0.1
├── shell-quote@1.4.3 (array-filter@0.0.1, array-map@0.0.0, array-reduce@0.0.0, jsonify@0.0.0)
├── bower-json@0.4.0 (intersect@0.0.3, deep-extend@0.2.11, graceful-fs@2.0.3)
├── semver@2.3.2
├── promptly@0.2.0 (read@1.0.5)
├── fstream@1.0.4 (inherits@2.0.1)
├── p-throttler@0.1.0 (q@0.9.7)
├── mkdirp@0.5.0 (minimist@0.0.8)
├── bower-config@0.5.2 (osenv@0.0.3, graceful-fs@2.0.3, optimist@0.6.1)
├── fstream-ignore@1.0.2 (inherits@2.0.1, minimatch@2.0.4)
├── tar-fs@0.5.2 (pump@0.3.5, tar-stream@0.4.7)
├── decompress-zip@0.0.8 (nopt@2.2.1, mkpath@0.1.0, touch@0.0.2, readable-stream@1.1.13, binary@0.3.0)
├── glob@4.0.6 (inherits@2.0.1, once@1.3.1, minimatch@1.0.0)
├── request@2.42.0 (caseless@0.6.0, json-stringify-safe@5.0.0, aws-sign2@0.5.0, forever-agent@0.5.2, stringstream@0.0.4, oauth-sign@0.4.0, tunnel-agent@0.4.0, qs@1.2.2, node-uuid@1.4.3, mime-types@1.0.2, form-data@0.1.4, bl@0.9.4, http-signature@0.10.1, tough-cookie@0.12.1, hawk@1.1.1)
├── bower-registry-client@0.2.4 (graceful-fs@2.0.3, request-replay@0.2.0, lru-cache@2.3.1, async@0.2.10, mkdirp@0.3.5, request@2.51.0)
├── cardinal@0.4.0 (redeyed@0.4.4)
├── mout@0.9.1
├── update-notifier@0.2.0 (semver-diff@0.1.0, string-length@0.1.2, latest-version@0.2.0, configstore@0.3.2)
├── handlebars@2.0.0 (optimist@0.3.7, uglify-js@2.3.6)
├── inquirer@0.7.1 (figures@1.3.5, mute-stream@0.0.4, through@2.3.6, readline2@0.1.1, lodash@2.4.1, cli-color@0.3.3, rx@2.4.7)
└── insight@0.4.3 (object-assign@1.0.0, chalk@0.5.1, async@0.9.0, lodash.debounce@2.4.1, os-name@1.0.3, tough-cookie@0.12.1, configstore@0.3.2, inquirer@0.6.0)
yo@1.4.6 /home/charles/.nvm/v0.11.16/lib/node_modules/yo
├── array-uniq@1.0.2
├── figures@1.3.5
├── titleize@1.0.0
├── user-home@1.1.1
├── opn@1.0.1
├── sort-on@1.0.2 (dot-prop@1.0.1)
├── humanize-string@1.0.1 (decamelize@1.0.0)
├── yeoman-character@1.0.1 (supports-color@1.3.1)
├── string-length@1.0.0 (strip-ansi@2.0.1)
├── async@0.9.0
├── cross-spawn@0.2.8 (lru-cache@2.5.0)
├── chalk@1.0.0 (escape-string-regexp@1.0.3, ansi-styles@2.0.1, supports-color@1.3.1, strip-ansi@2.0.1, has-ansi@1.0.3)
├── root-check@1.0.0 (sudo-block@1.1.1, downgrade-root@1.1.0)
├── findup@0.1.5 (commander@2.1.0, colors@0.6.2)
├── yosay@1.0.3 (ansi-regex@1.1.1, ansi-styles@2.0.1, strip-ansi@2.0.1, word-wrap@1.0.2, pad-component@0.0.1, taketalk@1.0.0, minimist@1.1.1)
├── meow@3.1.0 (object-assign@2.0.0, camelcase-keys@1.0.0, minimist@1.1.1, indent-string@1.2.1)
├── npm-keyword@1.1.1 (registry-url@3.0.0)
├── package-json@1.1.0 (registry-url@3.0.0)
├── got@2.5.0 (object-assign@2.0.0, lowercase-keys@1.0.0, timed-out@2.0.0, is-stream@1.0.1, infinity-agent@1.0.2, read-all-stream@1.0.2, prepend-http@1.0.1, statuses@1.2.1, duplexify@3.2.0)
├── update-notifier@0.3.1 (is-npm@1.0.0, latest-version@1.0.0, semver-diff@2.0.0)
├── fullname@1.1.0 (npmconf@2.1.1)
├── yeoman-environment@1.2.4 (escape-string-regexp@1.0.3, untildify@2.0.0, diff@1.3.1, text-table@0.2.0, chalk@0.5.1, debug@2.1.3, log-symbols@1.0.2, mem-fs@1.1.0, globby@1.2.0, grouped-queue@0.3.0)
├── insight@0.5.3 (object-assign@2.0.0, lodash.debounce@3.0.3, os-name@1.0.3, tough-cookie@0.12.1, request@2.54.0)
├── configstore@0.3.2 (object-assign@2.0.0, xdg-basedir@1.0.1, osenv@0.1.0, graceful-fs@3.0.6, uuid@2.0.1, mkdirp@0.5.0, js-yaml@3.2.7)
├── yeoman-doctor@1.3.2 (object-values@1.0.0, log-symbols@1.0.2, each-async@1.1.1, twig@0.7.2)
├── lodash@3.6.0
└── inquirer@0.8.2 (ansi-regex@1.1.1, cli-width@1.0.1, through@2.3.6, readline2@0.1.1, rx@2.4.7)
|
these were resolved with a simple
echo "export NODE_PATH=$NODE_PATH:/home/charles/.nvm/v0.11.16/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
Then re-run the npm install command, and everything should go smoothly.
Creating Yeoman Angular Template
This process is also shown here
install the yeoman angular template:
npm install -g generator-angular
Then make an angular project:
mkdir my-yo-project cd my-yo-project yo angular
This will ask you a few questions, then run bower install && npm install to install everything you need.
NOTE: The Yeoman team was brilliant enough to move bower_components [2] but not brilliant enough to update all the references to bower_components to be absolute, so everything that uses bower components is broken. This is because the browser is looking for bower components in /app/bower_components and not /bower_components. So there's basically no way to get your app to be served correctly.
Solution:
cd app/ ln -fs ../bower_components
Done. Results in the following page:
Okay, we've got our Yeoman-generated dummy site... Now what?
Well, this page gives an overview of all of the files that Yeoman created. You can serve up the page with a grunt webserver:
grunt server
or you can use Python's simple http server:
cd app python -m SimpleHTTPServer 8000
If you use grunt, you'll get live reloading for free. But since you still have to refresh the page to see updates, the grunt web server works exactly the same as the Python web server.
in one terminal window, you can serve the page:
grunt serve
Then in another window, edit the "Allo, Allo" message, which is in views/main.html. When you refresh the page, you'll see your changes updated live.
Hitting Some Turbulence
I ran into more snags trying to get this whole thing ironed out so that I could, uh, gee, ACTUALLY START ON MY PROJECT, 8 hours after setting out to get Angular.js built.
Problems with grunt serve
Grunt serve does not actually serve. It says it is hosting on localhost:9000, but it is not.
I can't access that port remotely at the machine's IP, with AA.BBB.CC.DD:9000, nor can I see it if I tunnel all HTTP traffic through a local port on the remote machine and visit port 9000. It ain't open anywhere.
Can't fix, don't understand, so I'm going to use Python. (I'm not even confident I know what language this is written in. Javascript??)
This is turning into the same horrible experience that the "magical" Ruby environment presented. I have no freaking clue what any of these tools are doing, how they work, why they're breaking, or what the hell's going on.
Problems with JSHint
Problems with Controllers in Unit Tests
Once I got the issues with jshint worked out, I ran into more problems with a controller not being defined:
$ grunt
Running "newer:jshint" (newer) task
Running "newer:jshint:all" (newer) task
Running "jshint:all" (jshint) task
>> 1 file lint free.
Running "newer-postrun:jshint:all:1:/home/charles/codes/15metro/angular-metro-app/node_modules/grunt-newer/.cache" (newer-postrun) task
Running "clean:server" (clean) task
>> 1 path cleaned.
Running "wiredep:app" (wiredep) task
Running "wiredep:test" (wiredep) task
Running "concurrent:test" (concurrent) task
Running "copy:styles" (copy) task
Copied 1 file
Done, without errors.
Execution Time (2015-03-30 15:07:39 UTC)
loading tasks 5ms ▇▇▇▇▇▇▇▇▇▇ 21%
copy:styles 18ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 75%
Total 24ms
Running "autoprefixer:server" (autoprefixer) task
File .tmp/styles/main.css created.
Running "autoprefixer:dist" (autoprefixer) task
File .tmp/styles/main.css created.
Running "connect:test" (connect) task
Started connect web server on http://localhost:9001
Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.31 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
WARN [watcher]: Pattern "/home/charles/codes/15metro/angular-metro-app/test/mock/**/*.js" does not match any file.
INFO [PhantomJS 1.9.8 (Linux)]: Connected on socket nlR4x0acvw9PLc9dOU8N with id 19852927
PhantomJS 1.9.8 (Linux) Controller: AboutCtrl should attach a list of awesomeThings to the scope FAILED
Error: [ng:areq] Argument 'AboutCtrl' is not a function, got undefined
http://errors.angularjs.org/1.3.15/ng/areq?p0=AboutCtrl&p1=not%20a%20function%2C%20got%20undefined
undefined
at assertArg (/home/charles/codes/15metro/angular-metro-app/bower_components/angular/angular.js:1587)
at assertArgFn (/home/charles/codes/15metro/angular-metro-app/bower_components/angular/angular.js:1598)
at /home/charles/codes/15metro/angular-metro-app/bower_components/angular/angular.js:8470
at /home/charles/codes/15metro/angular-metro-app/bower_components/angular-mocks/angular-mocks.js:1878
at /home/charles/codes/15metro/angular-metro-app/test/spec/controllers/about.js:15
at invoke (/home/charles/codes/15metro/angular-metro-app/bower_components/angular/angular.js:4203)
at workFn (/home/charles/codes/15metro/angular-metro-app/bower_components/angular-mocks/angular-mocks.js:2436)
TypeError: 'undefined' is not an object (evaluating 'scope.awesomeThings.length')
at /home/charles/codes/15metro/angular-metro-app/test/spec/controllers/about.js:20
PhantomJS 1.9.8 (Linux) Controller: MainCtrl should attach a list of awesomeThings to the scope FAILED
TypeError: 'undefined' is not an object (evaluating 'scope.awesomeThings.length')
at /home/charles/codes/15metro/angular-metro-app/test/spec/controllers/main.js:20
PhantomJS 1.9.8 (Linux): Executed 2 of 2 (2 FAILED) ERROR (0.011 secs / 0.012 secs)
Warning: Task "karma:unit" failed. Use --force to continue.
Aborted due to warnings.
Execution Time (2015-03-30 15:07:35 UTC)
jshint:all 116ms ▇▇▇ 2%
wiredep:app 196ms ▇▇▇▇ 3%
concurrent:test 4.1s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 70%
autoprefixer:server 78ms ▇▇ 1%
karma:unit 1.3s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 22%
Total 5.8s
|
Turns out, the key problem here was that I had two controllers corresponding to two pages, Main and About, but had accidentally named them both "MainCtrl", so the tests that Yeoman had automatically generated were breaking.
Bootswatch
How to get bootswatch working with Angular? I wanted to use Darkly theme, which is my go-to for Bootstrap projects: https://bootswatch.com/darkly/
So I ran bower install bootswatch. It worked! But now what?
Well, according to this thread on Stack Overflow, there's something wrong with how that package is set up on bower.
Oh. Okay. So I try this one: https://github.com/dbtek/bootswatch-dist
It is similar, but allows you to be more specific about what version you want to use.
bower install bootswatch-dist
It worked! But now what?
Dunno. I am unable to find instructions on HOW TO USE THIS THING. It explains how to use bower to install! great! But how about instructions for using it? In Angular? With whatever? How to set theme? How to change how the sass is compiled? Turn on LESS? SASS? Where is the CSS coming from?
Anyone?????
Help?????