From charlesreid1

Line 203: Line 203:
Fatal error: read ECONNRESET
Fatal error: read ECONNRESET
</pre>
</pre>
Solution: add an empty <code>.npmignore</code> file, so it doesn't try and use <code>.gitignore</code> instead.
Hat tip to [Stack Overflow http://stackoverflow.com/questions/17990647/npm-install-errors-with-error-enoent-chmod]


=Using Angular with Python=
=Using Angular with Python=

Revision as of 03:58, 30 March 2015

Installing: First Try

The first try with node.js from aptitude: Angular/FirstTry

Installing: Trying Again

This documentation is worthless.

The second try with node from aptitude: Angular/SecondTry

Installing: Third Try

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 http://stackoverflow.com/questions/17990647/npm-install-errors-with-error-enoent-chmod]

Using Angular with Python

Problem: most Python libraries are using Jinja or something similar, and those use double curly brackets {{ }}, conflicting with Angular.

Solution: use interpolateProvider variable to control start/end symbol https://docs.angularjs.org/api/ng/provider/$interpolateProvider