From charlesreid1

Installing

sudo apt-get install nodejs

Now repeat the installation procedure, but this time, set it up so that npm installs into your home directory [1] (that way, we don't have to deal with sudo):

echo prefix = ~/.node >> ~/.npmrc

Then add to .profile:

export PATH="$PATH:$HOME/.node/bin"

And if you want to start from scratch, you just remove ~/.node and start over.

Install Grunt and Bower

Now use npm to install grunt and bower, without sudo!

$ npm install -g grunt-cli
/home/charles/.node/bin/grunt -> /home/charles/.node/lib/node_modules/grunt-cli/bin/grunt
grunt-cli@0.1.13 /home/charles/.node/lib/node_modules/grunt-cli
├── nopt@1.0.10 (abbrev@1.0.5)
├── resolve@0.3.1
└── findup-sync@0.1.3 (lodash@2.4.1, glob@3.2.11)
$ npm install -g bower
/home/charles/.node/bin/bower -> /home/charles/.node/lib/node_modules/bower/bin/bower
bower@1.3.12 /home/charles/.node/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
├── bower-logger@0.2.2
├── lru-cache@2.5.0
├── 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
├── q@1.0.1
├── 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, strip-ansi@0.3.0, has-ansi@0.1.0)
├── shell-quote@1.4.3 (array-filter@0.0.1, array-map@0.0.0, array-reduce@0.0.0, jsonify@0.0.0)
├── semver@2.3.2
├── 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)
├── p-throttler@0.1.0 (q@0.9.7)
├── promptly@0.2.0 (read@1.0.5)
├── 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)
├── 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, http-signature@0.10.1, bl@0.9.4, tough-cookie@0.12.1, hawk@1.1.1)
├── glob@4.0.6 (inherits@2.0.1, once@1.3.1, minimatch@1.0.0)
├── 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, through@2.3.6, mute-stream@0.0.4, 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, 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)


Get Angular

git clone "git@github.com:angular/angular.js.git"


Build Angular

Start here:

cd angular.js

Build Node Dependencies

# Install node.js dependencies:
npm install

When I did this, I got some warnings, but no errors:

$ npm install
npm WARN unmet dependency /home/charles/codes/angular.js/node_modules/karma-sauce-launcher requires q@'~0.9.6' but will load
npm WARN unmet dependency /home/charles/codes/angular.js/node_modules/q,
npm WARN unmet dependency which is version 1.0.1
npm WARN unmet dependency /home/charles/codes/angular.js/node_modules/protractor requires q@'1.0.0' but will load
npm WARN unmet dependency /home/charles/codes/angular.js/node_modules/q,
npm WARN unmet dependency which is version 1.0.1
npm WARN unmet dependency /home/charles/codes/angular.js/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob requires minimatch@'0.3' but will load
npm WARN unmet dependency /home/charles/codes/angular.js/node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/minimatch,
npm WARN unmet dependency which is version 1.0.0
npm WARN unmet dependency /home/charles/codes/angular.js/node_modules/grunt-jscs/node_modules/jscs/node_modules/glob requires minimatch@'^1.0.0' but will load
npm WARN unmet dependency /home/charles/codes/angular.js/node_modules/grunt-jscs/node_modules/jscs/node_modules/minimatch,
npm WARN unmet dependency which is version 2.0.1

Install Bower Components

# Install bower components:
bower install

This was successful too:

 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

Build Angular

# Build AngularJS:
grunt package

This failed:

$ grunt package
Loading "jshint.js" tasks...ERROR
>> Error: Cannot find module '../maps/decode.json'
Loading "jscs.js" tasks...ERROR
>> Error: Cannot find module 'graceful-fs'
Loading "plugins.js" tasks...ERROR
>> Error: Cannot find module '../function/makeIterator_'
Loading "bp_build.js" tasks...ERROR
>> Error: Cannot find module 'rimraf'
Loading "bp_launch_chrome.js" tasks...ERROR
>> Error: Cannot find module 'rimraf'
Loading "bp_run.js" tasks...ERROR
>> Error: Cannot find module 'rimraf'

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 hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN optional dep failed, continuing fsevents@0.3.5
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN optional dep failed, continuing fsevents@0.2.1
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})

> 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 cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})

> 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
  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/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'

> 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

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

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'
npm ERR! cb() never called!
npm ERR! not ok code 0
Warning: Command failed: diff: node_modules/npm-shrinkwrap.cached.json: No such file or directory
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN optional dep failed, continuing fsevents@0.3.5
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN optional dep failed, continuing fsevents@0.2.1
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
npm ERR! cb() never called!
npm ERR! not ok code 0
 Use --force to continue.

Aborted due to warnings.