title: Using Parse with Angular2 (TypeScript)
body: <p>(Yes, I know angular2 is beta, but I'm just trying it out)</p>
  
  <p>I've followed the angular2 quickstart here: <a href="https://angular.io/docs/js/latest/quickstart.html" rel="nofollow">https://angular.io/docs/js/latest/quickstart.html</a></p>
  
  <p>And that's working fine. Now I want to try to use it with Parse, so I found out tsd was probably the way to go to access Parse from TypeScript.</p>
  
  <p>I went on and did:</p>
  
  <pre><code>tsd init
  tsd install parse --save
  </code></pre>
  
  <p>It added Parse (parse.d.ts) + its dependencies (node.d.ts, jquery.d.ts and underscore.d.ts.</p>
  
  <p>Now, the node.d.ts part was abit problematic since angular2 already had this added, so each definition was duplicated, I tried to solve this by:</p>
  
  <pre><code>Remove "typings/node" folder (node/node.d.ts)
  Remove '/// &lt;reference path="node/noded.ts" /&gt;' from typings/tsd.d.ts
  Remove '/// &lt;reference path="node/noded.ts" /&gt;' from typings/parse/parse.d.ts
  </code></pre>
  
  <p>I figured, this will work since node.d.ts is available already, right?</p>
  
  <p>Well, it's not working and I have no clue why. I get an error <code>node_modules/angular2/typings/angular-protractor/angular-protractor.d.ts(1679,13): error TS2403: Subsequent variable declarations must have the same type.  Variable '$' must be of type 'JQueryStatic', but here has type 'cssSelectorHelper'.</code> But this is not the main problem, because it looks like proceeds after that.</p>
  
  <p>This is what makes <code>npm start</code> "crash":</p>
  
  <pre><code>[1] events.js:141
  [1]       throw er; // Unhandled 'error' event
  [1]       ^
  [1] 
  [1] Error: watch node_modules/angular2/es6/dev/examples/core/ts/bootstrap/bootstrap.js ENOSPC
  [1]     at exports._errnoException (util.js:855:11)
  [1]     at FSWatcher.start (fs.js:1313:19)
  [1]     at Object.fs.watch (fs.js:1341:11)
  [1]     at createFsWatchInstance (/home/david/repo/angular2-toodeloo/node_modules/chokidar/lib/nodefs-handler.js:37:15)
  [1]     at setFsWatchListener (/home/david/repo/angular2-toodeloo/node_modules/chokidar/lib/nodefs-handler.js:80:15)
  [1]     at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/david/repo/angular2-toodeloo/node_modules/chokidar/lib/nodefs-handler.js:228:14)
  [1]     at FSWatcher.NodeFsHandler._handleFile (/home/david/repo/angular2-toodeloo/node_modules/chokidar/lib/nodefs-handler.js:255:21)
  [1]     at FSWatcher.&lt;anonymous&gt; (/home/david/repo/angular2-toodeloo/node_modules/chokidar/lib/nodefs-handler.js:473:21)
  [1]     at FSReqWrap.oncomplete (fs.js:82:15)
  </code></pre>
  
  <p>Full output can be found here: <a href="http://pastebin.com/xE3u3qUh" rel="nofollow">http://pastebin.com/xE3u3qUh</a></p>
  
  <p><em>UPDATE</em></p>
  
  <p>I relized the error above was in the angular2 examples, so I removed the examples and got rid of the error. But when I did "npm install parse", the error was back, but in another place.. This time: <code>Error: watch node_modules/opt-merger/node_modules/lodash/lang/isFunction.js ENOSPC</code></p>