GithubHelp home page GithubHelp logo

angular2-rxjs-chat's Introduction

Angular 2 RxJS Chat

Angular 2 RxJS Chat Join the chat at https://gitter.im/ng-book/ng-book

An Angular 2 chat app using Angular 2, RxJS, Angular CLI, Webpack, TypeScript, Services, Injectables, Karma, Forms, and tslint by the ng-book 2 team

This repo shows an example chat application using RxJS and Angular 2. The goal is to show how to use the Observables data architecture pattern within Angular 2. It also features:

  • Angular CLI, which configures Webpack with TypeScript, Karma, and tslint
  • Writing async components that work with RxJS
  • How to write injectable services in Angular 2
  • And much more

Angular 2 RxJS Chat

Try the live demo here

Quick start

# clone the repo
git clone https://github.com/ng-book/angular2-rxjs-chat.git

# change into the repo directory
cd angular2-rxjs-chat

# install
npm install

# run
npm start

Then visit http://localhost:4200 in your browser.

Architecture

The app has three models:

  • Message - holds individual chat messages
  • Thread - holds metadata for a group of Messages
  • User - holds data about an individual user

Model Diagram

And there are three services, one for each model:

There are also three top-level components:

  • ChatNavBar - for the top navigation bar and unread messages count
  • ChatThreads - for our clickable list of threads
  • ChatWindow - where we hold our current conversation

Angular 2 RxJS Chat

Services Manage Observables

Each service publishes data as RxJS streams. The service clients subscribe to these streams to be notified of changes.

The MessagesService is the backbone of the application. All new messages are added to the newMessages stream and, more or less, all streams are derived from listening to newMessages. Even the Threads exposed by the ThreadsService are created by listening to the stream of Messages.

There are several other helpful streams that the services expose:

For example, the MessagesService exposes the messages stream which is a stream of the list of the all current messages. That is, messages emits an array for each record.

Similarly, the ThreadsService exposes a list of the chronologically-ordered threads in orderedThreads and so on.

Understanding how RxJS streams can be tricky, but this code is heavily commented. One strategy to grokking this code is to start at the components and see how they use the services. The other strategy is to get a copy of ng-book 2 where we explain each line in detail over ~60 pages.

Bots

This app implements a few simple chat bots. For instance:

  • Echo bot
  • Reversing bot
  • Waiting bot

Angular 2 RxJS Chat Bots

Detailed Installation

Step 1: Install Node.js from the Node Website.

We recommend Node version 4.1 or above. You can check your node version by running this:

$ node -v
vv4.1...

Step 2: Install Dependencies

npm install

Running the App

npm run go

Then visit http://localhost:4200 in your browser.

Running the Tests

You can run the unit tests with:

npm run test

Future Plans

There are two big changes we plan to make to this repo:

1. Add HTTP Requests

Currently the bots are all client-side and there are no HTTP requests involved in the chats.

We will move the chat bots to a server and integrate API requests into this project once the Angular 2 HTTP client development has settled down.

2. ON_PUSH change detection

Because we're using observables, we can improve the performance of these components by using ON_PUSH change detection. Again, once Angular 2 development stabilizes, we'll be making this change.

Contributing

There are lots of other little things that need cleaned up such as:

  • More tests
  • Cleaning up the vendor scripts / typings
  • Simplifying the unread messages count

If you'd like to contribute, feel free to submit a pull request and we'll likely merge it in.

Getting Help

If you're having trouble getting this project running, feel free to open an issue, join us on Gitter, or email us!


ng-book 2

ng-book 2

This repo was written and is maintained by the ng-book 2 team. In the book we talk about each line of code in this app and explain why it's there and how it works.

This app is only one of several apps we have in the book. If you're looking to learn Angular 2, there's no faster way than by spending a few hours with ng-book 2.

License

MIT

angular2-rxjs-chat's People

Contributors

daynedavis avatar gitter-badger avatar jashmenn avatar maxx0r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular2-rxjs-chat's Issues

webpack module resolution errors

I'm running under windows 7, working through ng-book2-r8, and would love to see this code in action.

npm install seems to work fine. npm run server does not, it seems not to be able to work with many of the files referenced from vendor.js. I have no experience with webpack, not sure how to debug and the configuration is complex. When loading the page all I see is the Fork Me on Github image, and 404s for traceur, system, and angular2 scripts.

Output from webpack:

   [0] multi vendor 52 bytes {1} [built]
 [347] ./app/vendor.js 243 bytes {1} [built] [1 error]
 [348] ./vendor/traceur-runtime-0.0.87.js 46.7 kB {1} [built]
...
  [375] (webpack)/~/node-libs-browser/~/crypto-browserify/~/pbkdf2-compat/pbkdf2.js 2.06 kB {1} [built]
  [377] ./vendor/[email protected] 30.7 kB {1} [built] [2 errors]
  [378] ./vendor/es6-shim.js 117 kB {1} [optional] [built]
  [379] ./vendor/system-0.16.11.js 26.1 kB {1} [built] [1 error]
  [380] (webpack)/~/node-libs-browser/~/vm-browserify/index.js 3.8 kB {1} [built]
...
WARNING in ./vendor/traceur-runtime-0.0.87.js
Critical dependencies:
2:18427-18468 the request of a dependency is an expression
 @ ./vendor/traceur-runtime-0.0.87.js 2:18427-18468

WARNING in ./vendor/system-0.16.11.js
Critical dependencies:
5:1342-1349 require function is used in a way in which dependencies cannot be statically extracted
5:9069-9076 require function is used in a way in which dependencies cannot be statically extracted
 @ ./vendor/system-0.16.11.js 5:1342-1349 5:9069-9076

WARNING in ./vendor/[email protected]
Critical dependencies:
1:379-386 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results

 @ ./vendor/[email protected] 1:379-386

WARNING in ./vendor/angular2.dev.2.0.0-alpha.35.js
Critical dependencies:
19:113-120 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better result
.
 @ ./vendor/angular2.dev.2.0.0-alpha.35.js 19:113-120

WARNING in ./vendor/angular2.dev.2.0.0-alpha.35.js
Critical dependencies:
2005:113-120 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better resu
ts.
 @ ./vendor/angular2.dev.2.0.0-alpha.35.js 2005:113-120

WARNING in ./app/ts/components/ChatNavBar.ts
[18, 1]: exceeds maximum line length of 80


ERROR in ./vendor/[email protected]
Module parse failed: c:\dev\angular2\ngbook2\git\angular2-rxjs-chat\vendor\[email protected] Line 5: Unexpected token {

<<<deleted contents of css file output>>>

You may need an appropriate loader to handle this file type.@ ./app/vendor.js 5:0-41

ERROR in ./vendor/system-0.16.11.js
Module not found: Error: Cannot resolve module 'es6-module-loader' in C:\dev\angular2\ngbook2\code\rxjs\chat\vendor
 @ ./vendor/system-0.16.11.js 5:25146-25174

ERROR in ./vendor/[email protected]
Module not found: Error: Cannot resolve module 'when/es6-shim/Promise' in C:\dev\angular2\ngbook2\code\rxjs\chat\vendor
 @ ./vendor/[email protected] 1:21611-21643 1:26981-27013

ERROR in ./vendor/[email protected]
Module not found: Error: Cannot resolve module 'fs' in C:\dev\angular2\ngbook2\code\rxjs\chat\vendor
 @ ./vendor/[email protected] 1:27869-27882

Other info:

npm -version
2.11.3

Other problems:
Microsoft visual code reports 5 errors in [email protected], all \9's (messed up tabs I guess) in the minified file.

Build code structure

Which tool we use to build code structure?
Can you make it more detail to help start this demo easier?

How to do http

Hi I would like to work on adding http requests to the repo, so the bots live on a nodejs server.

Any tips, guidance on how to modify the client side?

Question: Sharing the Stream In Data Architecture with Observable - Part1

Hi,I read the chapter by Sharing the Stream In Data Architecture with Observable . I have a question,I can't understand why to use publishRepaly(1) and refCount() method to collect messages.

First, I know publishRepaly(1) mean to save 1 value

Second, I know refCount() mean automate publish message and needn't use connect() method.

But, I don't know why to design for it.

Thx

how does cleanup work for observables.

I didn't see any unsubscribe or takeUtil in the MessageService. How does cleanup work?

If I create a new instance for MessageService for each test how would the old subscription clean up?

Issue while running application in IE

I downloaded the code. Ran npm install and then npm start.

The application is working fine in Chrome browser. But its failing in IE-11.
Getting following error:
SCRIPT5007: Unable to get property 'apply' of undefined or null reference
vendor.bundle.js (64186,5)

However, when I access http://rxjs.ng-book.com/ in IE-11, demo is working fine.

Kindly let me know, if I need to do any changes in the code before it can be accessible in IE.

npm install fails on reflect-metadata

I am using the source code from the zip download that includes all the ng-book 2 material. Here is the output of npm install

Vincents-MacBook-Pro-2:chat vincentgabriel$ npm install
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] scripts['server'] should probably be scripts['start'].
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated [email protected]: Deprecated.

> [email protected] preinstall /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/live-server/node_modules/watchr/node_modules/bal-util/node_modules/typechecker
> node ./cyclic.js

WARN engine [email protected]: wanted: {"node":">= 0.10.0 <= 0.11.0"} (current: {"node":"4.2.4","npm":"2.14.14"})

> [email protected] install /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/phantomjs
> node install.js

PhantomJS not found on PATH
Download already available at /var/folders/gd/m23jd5qd5l33v859py863mt00000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip
Verified checksum of previously downloaded file
Extracting zip contents
Removing /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/phantomjs/lib/phantom
Copying extracted folder /var/folders/gd/m23jd5qd5l33v859py863mt00000gn/T/phantomjs/phantomjs-1.9.8-macosx.zip-extract-1452622532725/phantomjs-1.9.8-macosx -> /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/phantomjs/lib/phantom/bin/phantomjs
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated [email protected]: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
\
> [email protected] postinstall /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/node-sass/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall

-
> [email protected] install /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/node-sass/vendor/darwin-x64-46/binding.node
npm WARN peerDependencies The peer dependency [email protected] included from angular2 will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

> [email protected] install /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/karma/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/karma/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" is installed via remote

> [email protected] install /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" is installed via remote

> [email protected] postinstall /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/node-sass
> node scripts/build.js

` /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/node_modules/node-sass/vendor/darwin-x64-46/binding.node ` exists. 
 testing binary.
Binary is fine; exiting.
npm ERR! Darwin 15.2.0
npm ERR! argv "/opt/local/bin/node" "/opt/local/bin/npm" "install"
npm ERR! node v4.2.4
npm ERR! npm  v2.14.14
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/vincentgabriel/Sites/manuscript/code/rxjs/chat/npm-debug.log

Thank You.

Error webpack-dev-server

Hello, I cloned the repository and follow the installation Arians, but when running npm run server, have the following error:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'server' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink C:\Program Files\nodejs\node.exe
5 verbose run-script [ 'preserver', 'server', 'postserver' ]
6 info preserver [email protected]
7 info server [email protected]
8 verbose unsafe-perm in lifecycle true
9 info [email protected] Failed to exec server script
10 verbose stack Error: [email protected] server: webpack-dev-server
10 verbose stack Exit status 1
10 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
10 verbose stack at EventEmitter.emit (events.js:110:17)
10 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
10 verbose stack at ChildProcess.emit (events.js:110:17)
10 verbose stack at maybeClose (child_process.js:1015:16)
10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
11 verbose pkgid [email protected]
12 verbose cwd C:\xampp\htdocs\Laravel\AngularChat\angular2-rxjs-chat
13 error Windows_NT 6.1.7601
14 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "server"
15 error node v0.12.3
16 error npm v2.9.1
17 error code ELIFECYCLE
18 error [email protected] server: webpack-dev-server
18 error Exit status 1
19 error Failed at the [email protected] server script 'webpack-dev-server'.
19 error This is most likely a problem with the angular2-rxjs-chat package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error webpack-dev-server
19 error You can get their info via:
19 error npm owner ls angular2-rxjs-chat
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]

Decouple bootstrap from style.css

Is there a possible way to use bootstrap independently and remove it from styles.css.
And include it in .angular-cli.json like so:
"styles": [ "../node_modules/bootstrap/dist/css/bootstrap.css", "styles.css" ]

Unused packages: ngrx/core, ngrx/store

In the package.json file I found references to ngrx/core, ngrx/store and ngrx-store-logger but when I looked through the code I found that they are not actually used.
I think they should be removed as it is confusing for anyone trying to understand the architecture of the app.
It lead me to believe you have a redux implementation side by side with an ngrx\store one (which I don't think is a bad idea after all).
Thanks,
Alex Pop

Unexpected token You may need an appropriate loader to handle this file type.

Help me
[60] (webpack)-dev-server/client?http://localhost:8080 2.14 kB {2} [built]

ERROR in ./app/ts/vendor.ts
Module parse failed: E:\03. Work\01.JavaCript\02. AngularJS\test\angular2-rxjs-chat\node_modules\tslint-loader\index.js!E:\03. Work\01.JavaCript\02. AngularJS\test\angular2-rxjs-chat\app\ts\vendor.ts Line 2: Unexpected token
You may need an appropriate loader to handle this file type.
| // Polyfills
| import 'core-js/es6';
| import 'core-js/es6';
| import 'core-js/es7/reflect';
@ multi vendor

ERROR in ./app/ts/app.ts
Module parse failed: E:\03. Work\01.JavaCript\02. AngularJS\test\angular2-rxjs-chat\node_modules\tslint-loader\index.js!E:\03. Work\01.JavaCript\02. AngularJS\test\angular2-rxjs-chat\app\ts\app.ts Line 9: Unexpected token
You may need an appropriate loader to handle this file type.
| */
|
| import {
| NgModule,
| Component
@ multi app
webpack: Failed to compile.

Incoming message from socket.io is not added to message stream

I have implemented socket.io with node.js server everything is work fine I can send message to chat server but when other browser application receives the message Its being not added to message stream.

@Injectable()
export class ChatService {
  socket: any;
  constructor(public messagesService: MessagesService) {
    this.socket_connect();
    this.socket.on('get:group-message', (message: any) => {
      this.messagesService.addMessage(message);
    });
  }
}

Here get:group-message I'm getting message from other user but not able to display it.
Can you help me what I'm missing ?

Problem running chat app

Hello I have this error and I can't find the way to make it work. If you have any suggestions, I would really appreciate it. Thanks!

`112055242NB004:angular2-rxjs-chat valilogi$ npm run go

[email protected] go /Users/valilogi/GitHub/angular/angular2-rxjs-chat
webpack-dev-server --display-reasons --display-chunks

{ cache: true,
debug: true,
verbose: true,
displayErrorDetails: true,
displayReasons: true,
displayChunks: true,
context: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat',
entry:
{ vendor: './app/ts/vendor.ts',
app:
[ 'webpack-dev-server/client?http://0.0.0.0:8080',
'./app/ts/app.ts' ] },
stats: { colors: true, reasons: true },
devtool: 'source-map',
recordsPath: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/.webpack.json',
devServer:
{ inline: true,
colors: true,
contentBase: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/build',
publicPath: '/' },
output:
{ path: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/build',
filename: '[name].js',
publicPath: '/',
chunkFilename: '[id].bundle.js',
hotUpdateMainFilename: 'updates/[hash].update.json',
hotUpdateChunkFilename: 'updates/[hash].[id].update.js' },
plugins:
[ IgnorePlugin { resourceRegExp: /spec.js$/, contextRegExp: undefined },
CommonsChunkPlugin {
chunkNames: 'vendor',
filenameTemplate: 'vendor.js',
minChunks: Infinity,
selectedChunks: undefined,
async: undefined,
minSize: undefined,
ident: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/node_modules/webpack/lib/optimize/CommonsChunkPlugin.js0' },
CommonsChunkPlugin {
chunkNames: 'common',
filenameTemplate: 'common.js',
minChunks: 2,
selectedChunks: [ 'app', 'vendor' ],
async: undefined,
minSize: undefined,
ident: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/node_modules/webpack/lib/optimize/CommonsChunkPlugin.js1' },
ExtractTextPlugin { filename: 'styles.css', options: {}, id: 1 },
DefinePlugin { definitions: { VERSION: '"1.0.0"', ENV: undefined } },
HtmlWebpackPlugin {
options: { template: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/app/index.html' } },
WebpackReloadPlugin { ip: 'localhost' },
{ options: { title: 'ng-book' }, lastBuildSucceeded: false } ],
resolveLoader:
{ root: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/node_modules',
modulesDirectories: [ 'node_modules' ],
fallback: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/node_modules' },
resolve:
{ root: [ '/Users/valilogi/GitHub/angular/angular2-rxjs-chat' ],
modulesDirectories: [ 'node_modules', 'app', 'app/ts', '.' ],
extensions: [ '', '.ts', '.js', '.json', '.css' ],
alias:
{ app: 'app',
scripts: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/node_modules' } },
module:
{ preLoaders: [ { test: /.ts$/, loader: 'tslint' } ],
loaders:
[ { test: /.(png|jpg|gif)$/,
loader: 'url-loader?limit=50000&name=[path][name].[ext]' },
{ test: /.json$/, loader: 'json' },
{ test: /^(?!..min.css$)..css$/,
loader: '/Users/valilogi/GitHub/angular/angular2-rxjs-chat/node_modules/extract-text-webpack-plugin/loader.js?{"omit":1,"extract":true,"remove":true}!style-loader!css-loader?sourceMap' },
{ test: /.scss$/,
loaders:
[ 'style-loader',
'/Users/valilogi/GitHub/angular/angular2-rxjs-chat/node_modules/extract-text-webpack-plugin/loader.js?{"omit":1,"extract":true,"remove":true}!style-loader!css-loader?sourceMap',
'sass-loader?outputStyle=expanded&root=/Users/valilogi/GitHub/angular/angular2-rxjs-chat/app&&includePaths[]/Users/valilogi/GitHub/angular/angular2-rxjs-chat/node_modules&&includePaths[]/Users/valilogi/GitHub/angular/angular2-rxjs-chat/app' ] },
{ test: /.svg(?v=\d+.\d+.\d+)?$/, loader: 'url-loader' },
{ test: /.html$/, loader: 'raw' },
{ test: /^index.html$/,
loader: 'file-loader?name=[path][name].[ext]' },
{ test: /.ts$/,
loader: 'ts',
exclude: [ /test/, /node_modules/ ] },
{ test: /vendor/..(css|js)/,
loader: 'file-loader?name=[path][name].[ext]',
exclude: [ /node_modules/ ] },
{ test: /.woff(2)?(?v=\d+.\d+.\d+)?$/,
loader: 'file-loader?mimetype=application/font-woff&name=[path][name].[ext]' },
{ test: /.ttf(?v=\d+.\d+.\d+)?$/,
loader: 'file-loader?mimetype=application/x-font-ttf&name=[path][name].[ext]' },
{ test: /.eot(?v=\d+.\d+.\d+)???$/,
loader: 'file-loader?mimetype=application/vnd.ms-fontobject&name=[path][name].[ext]' },
{ test: /.otf(?v=\d+.\d+.\d+)?$/,
loader: 'file-loader?mimetype=application/font-otf&name=[path][name].[ext]' },
{ test: /.svg(?v=\d+.\d+.\d+)?$/, loader: 'url-loader' } ],
noParse: [ /.min.js/, /vendor[/].
?.(js|css)$/ ] },
tslint: { emitErrors: false, failOnHint: false } }
events.js:160
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE 127.0.0.1:8080
at Object.exports._errnoException (util.js:1008:11)
at exports._exceptionWithHostPort (util.js:1031:20)
at Server._listen2 (net.js:1253:14)
at listen (net.js:1289:10)
at net.js:1399:9
at GetAddrInfoReqWrap.asyncCallback as callback
at GetAddrInfoReqWrap.onlookup as oncomplete

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "go"
npm ERR! node v6.3.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] go: webpack-dev-server --display-reasons --display-chunks
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] go script 'webpack-dev-server --display-reasons --display-chunks'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-rxjs-chat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server --display-reasons --display-chunks
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-rxjs-chat
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-rxjs-chat
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/valilogi/GitHub/angular/angular2-rxjs-chat/npm-debug.log`

Failed to load resource on http://localhost:8080/rxjs

Hi there,

I ran the example successfully. However, when I put

import { Observable } from 'rxjs';

in my own TestService.ts, it gave me this error:

Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8080/rxjs

It seems I couldn't find the rxjs file in my node_modules.

Any advice on this problem is very much appreciated.

`npm install` fails with Node 4.0

Hello ng-book Team! Thanks for providing us this great example application!

As a real hipster interested in the latest bleeding edge tech demo I'm also using the latest toolchain. I'm even as lame as using the latest stable version only ;-)

➜ angular2-rxjs-chat.git git:(master) node --version ; and npm --version
v4.0.0
2.14.2

npm install reports a ton of errors. I'm not sure if and how many of them are actually relevant for this demo. The final running application under http://localhost:8080/ seems to be dysfunctional and does not react to any clicks.

npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] scripts['server'] should probably be scripts['start'].
npm WARN package.json Dependency 'webpack' exists in both dependencies and devDependencies, using 'webpack@^1.10.1' from dependencies
npm WARN engine [email protected]: wanted: {"node":">=0.10 <=0.12 || >=1 <=3"} (current: {"node":"4.0.0","npm":"2.14.2"})

> [email protected] preinstall /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/live-server/node_modules/watchr/node_modules/bal-util/node_modules/typechecker
> node ./cyclic.js

npm WARN optional dep failed, continuing [email protected]
npm WARN engine [email protected]: wanted: {"node":">= 0.10.0 <= 0.11.0"} (current: {"node":"4.0.0","npm":"2.14.2"})

> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/phantomjs
> node install.js

Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Using proxy http://proxy.exxcellent.de:3128/
Receiving...
\ [======================================--] 95% 0.0s-
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1441990354823/phantomjs-1.9.8-linux-x86_64 -> /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/phantomjs/lib/phantom/bin/phantomjs
npm WARN optional dep failed, continuing [email protected]

> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build« wird betreten
  CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:261:52: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                                                    ^
../node_modules/nan/nan.h:256:52: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                                                    ^
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../src/validation.cc:10:0:
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/validation/src/validation.o] Fehler 1
make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build« wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-26-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
npm WARN deprecated [email protected]: use node-gyp@3+, it does all the things

> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build« wird betreten
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:261:52: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                                                    ^
../node_modules/nan/nan.h:256:52: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                                                    ^
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../src/bufferutil.cc:10:0:
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Fehler 1
make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build« wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-26-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]

> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build« wird betreten
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:261:52: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                                                    ^
../node_modules/nan/nan.h:256:52: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                                                    ^
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../src/bufferutil.cc:10:0:
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Fehler 1
make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build« wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-26-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]

> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build« wird betreten
  CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:261:52: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                                                    ^
../node_modules/nan/nan.h:256:52: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                                                    ^
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../src/validation.cc:10:0:
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/validation/src/validation.o] Fehler 1
make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build« wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-26-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]

> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build« wird betreten
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:261:52: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                                                    ^
../node_modules/nan/nan.h:256:52: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                                                    ^
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../src/bufferutil.cc:10:0:
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Fehler 1
make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build« wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-26-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]

> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build« wird betreten
  CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:261:52: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                                                    ^
../node_modules/nan/nan.h:256:52: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                                                    ^
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../src/validation.cc:10:0:
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/validation/src/validation.o] Fehler 1
make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build« wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-26-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/webpack-dev-server/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]

> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build« wird betreten
  CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:261:52: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                                                    ^
../node_modules/nan/nan.h:256:52: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                                                    ^
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../src/validation.cc:10:0:
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/validation.cc:15:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/validation/src/validation.o] Fehler 1
make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build« wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-26-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]

> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build« wird betreten
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:261:52: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                                                    ^
../node_modules/nan/nan.h:256:52: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                                                    ^
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:672:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:672:67: note: candidates are:
In file included from ../src/bufferutil.cc:10:0:
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:31:29: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                             ^
/home/ben/.node-gyp/4.0.0/include/node/node_buffer.h:43:29: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/bufferutil.cc:16:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:676:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Fehler 1
make: Verzeichnis »/home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build« wird verlassen
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-26-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]
npm WARN optional dep failed, continuing [email protected]
/
> [email protected] install /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/node-sass
> node scripts/install.js

Binary downloaded and installed at /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/node-sass/vendor/linux-x64-46/binding.node

> [email protected] postinstall /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/node-sass
> node scripts/build.js

` /home/ben/projects/demo.angular2-rxjs-chat.git/node_modules/node-sass/vendor/linux-x64-46/binding.node ` exists. 
 testing binary.
Binary is fine; exiting.
[email protected] node_modules/raw-loader

[email protected] node_modules/on-build-webpack

[email protected] node_modules/webpack-reload-plugin

[email protected] node_modules/script-loader

[email protected] node_modules/karma-jasmine

[email protected] node_modules/karma-sourcemap-loader

[email protected] node_modules/uuid

[email protected] node_modules/underscore

[email protected] node_modules/karma-spec-reporter
└── [email protected]

[email protected] node_modules/optimist
├── [email protected]
└── [email protected]

[email protected] node_modules/jasmine-core

[email protected] node_modules/karma-chrome-launcher
├── [email protected] ([email protected])
└── [email protected] ([email protected])

[email protected] node_modules/es6-shim

[email protected] node_modules/es5-shim

[email protected] node_modules/chunk-manifest-webpack-plugin
└── [email protected] ([email protected])

[email protected] node_modules/reflect-metadata

[email protected] node_modules/val-loader
└── [email protected] ([email protected], [email protected])

[email protected] node_modules/extract-text-webpack-plugin
├── [email protected]
└── [email protected] ([email protected], [email protected])

[email protected] node_modules/sass-loader
└── [email protected] ([email protected], [email protected])

[email protected] node_modules/imports-loader
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])

[email protected] node_modules/file-loader
└── [email protected] ([email protected], [email protected])

[email protected] node_modules/url-loader
├── [email protected]
└── [email protected] ([email protected], [email protected])

[email protected] node_modules/style-loader
└── [email protected] ([email protected], [email protected])

[email protected] node_modules/live-server
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/phantomjs
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/karma-phantomjs-launcher
└── [email protected]

[email protected] node_modules/karma-webpack
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected]

[email protected] node_modules/html-webpack-plugin
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected]

[email protected] node_modules/webpack-dev-server
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/traceur-loader
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/es6-symbol
├── [email protected]
└── [email protected] ([email protected])

[email protected] node_modules/awesome-typescript-loader
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected]

[email protected] node_modules/moment

[email protected] node_modules/webpack-notifier
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/karma
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected]

[email protected] node_modules/webpack
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/tsd
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected])

[email protected] node_modules/rx

[email protected] node_modules/bootstrap-sass

[email protected] node_modules/tslint-loader
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected])

[email protected] node_modules/css-loader
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/typescript

[email protected] node_modules/node-sass
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] node_modules/angular2
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected]

Operation on messages in rx-js-chat

this.messages = this.updates
      // watch the updates and accumulate operations on the messages
      .scan((messages: Message[],
             operation: IMessagesOperation) => {
               return operation(messages);
             },

In above code snippet, what operation exactly is ? - "return operation(messages);". I don't see "operation" defined anywhere except there is an interface. I am looking for concrete method.

Thanks!

Question on Multi Chatrooms

This resource is incredibly helpful thanks so much! Do you have any examples of how I would create a multi inboxes for each user on my platform? I have been able to implement this but am not sure quite how to have a separate inbox for each user?

TypeError: Cannot read property 'name' of undefined when open in chrome

TypeError: Cannot read property 'name' of undefined
    at AbstractChangeDetector.ChangeDetector_ChatWindow_comp_0.detectChangesInRecordsInternal (eval at <anonymous> (http://localhost:8080/bundle.js:4509:17), <anonymous>:29:33)
    at AbstractChangeDetector.detectChangesInRecords (http://localhost:8080/bundle.js:4820:19)
    at AbstractChangeDetector.runDetectChanges (http://localhost:8080/bundle.js:4797:15)
    at AbstractChangeDetector._detectChangesInShadowDomChildren (http://localhost:8080/bundle.js:4883:19)
    at AbstractChangeDetector.runDetectChanges (http://localhost:8080/bundle.js:4801:15)
    at AbstractChangeDetector._detectChangesInShadowDomChildren (http://localhost:8080/bundle.js:4883:19)
    at AbstractChangeDetector.runDetectChanges (http://localhost:8080/bundle.js:4801:15)
    at AbstractChangeDetector.detectChanges (http://localhost:8080/bundle.js:4790:74)
    at LifeCycle.tick (http://localhost:8080/bundle.js:26340:35)
    at http://localhost:8080/bundle.js:26316:61

as above, I got this error when run the server step by step... is it a bug or just i miss some step?

Getting lot of errors after running npm install

pm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:....\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v6.2.2
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1 npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users..\Documents\Chat\Chat Git\npm-debug.log

ng e2e fails because it cannot find type definition file for 'jasmine' and 'node'

Had to add a line :
import {} from 'jasmine';
to the file app.e2e-spec.ts.

Have also invoked : npm install at type/node and npm install at type/jasmine'. ( Somehow editor is not displaying the at symbol properly )

However, ng e2e still failed because it could not find type definition file for 'jasmine' and 'node'.

Below is the transcript from the shell:

ng e2e
** NG Live Development Server is listening on localhost:49152, open your browser on http://localhost:49152 **
(node:15768) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
Hash: 576aec247a956d2fa97b
Time: 14135ms
chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 157 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.js.map (main) 43.7 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 201 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.03 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
[21:47:21] I/update - chromedriver: file exists C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.36.zip
[21:47:21] I/update - chromedriver: unzipping chromedriver_2.36.zip
[21:47:22] I/update - chromedriver: chromedriver_2.36.exe up to date
[21:47:22] I/launcher - Running 1 instances of WebDriver
[21:47:22] I/direct - Using ChromeDriver directly...
[21:47:24] E/launcher - Error: TSError: ⨯ Unable to compile TypeScript
Cannot find type definition file for 'jasmine'. (2688)
Cannot find type definition file for 'node'. (2688)
at getOutput (C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\ts-node\src\index.ts:312:17)
at C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\ts-node\src\index.ts:343:18
at Object.compile (C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\ts-node\src\index.ts:476:19)
at Module.m._compile (C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\ts-node\src\index.ts:406:44)
at Module._extensions..js (module.js:646:10)
at Object.require.extensions.(anonymous function) [as .ts] (C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\ts-node\src\index.ts:409:12)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\jasmine\lib\jasmine.js:93:5
at Array.forEach ()
at Jasmine.loadSpecs (C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\jasmine\lib\jasmine.js:92:18)
at Jasmine.execute (C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\jasmine\lib\jasmine.js:197:8)
at C:\cprojects\pp\angular\angular2-rxjs-chat\node_modules\protractor\built\frameworks\jasmine.js:132:15
[21:47:24] E/launcher - Process exited with error code 100

Models Structure Infinite Loop

Hi there! I just wanted to make you know that this chat is really elaborated and I would like to thank you to make it available as a demo.

Well, the actual issue is that your Models Structure has got an infinite loop at the Messages Model with the Thread Model. I just wonder if this is made as intended or it's a real bug.

Have a great day jashmenn!

screenshot_2

Module parse failed on 'npm run server'

Hey :) Thanks for this greate example, I just have a similar issue like #5, I cannot view the example with npm run server.
The Karma tests do work tough.

The Error output is:

ERROR in ./app/ts/app.ts
Module parse failed: /Users/mathiasmaier/Projects/test/angular2-rxjs-chat/node_modules/tslint-loader/index.js!/Users/mathiasmaier/Projects/test/angular2-rxjs-chat/app/ts/app.ts Line 6: Unexpected token
You may need an appropriate loader to handle this file type.
|  * Angular
|  */
| import {Component, bootstrap, View} from "angular2/angular2";
| 
| /*
 @ multi bundle
webpack: bundle is now VALID.

Before that, webpack puts out a log of logging, which all seems ok, exept for one line, which is:

content is served from /Users/mathiasmaier/Projects/test/angular2-rxjs-chat/build
Hash: bd365835c26445c751b1
Version: webpack 1.12.2
Time: 2460ms
                                  Asset       Size  Chunks             Chunk Names
                              vendor.js     389 kB       1  [emitted]  vendor
     _/vendor/traceur-runtime-0.0.87.js    46.7 kB          [emitted]  
   _/vendor/[email protected]    30.7 kB          [emitted]  
_/vendor/angular2.dev.2.0.0-alpha.35.js    1.19 MB          [emitted]  
       _/vendor/[email protected]     123 kB          [emitted]  
                              bundle.js    2.35 kB       0  [emitted]  bundle
             _/vendor/system-0.16.11.js    26.1 kB          [emitted]  
                                core.js     189 kB       2  [emitted]  core.js
                          bundle.js.map    2.98 kB       0  [emitted]  bundle
                          vendor.js.map     462 kB       1  [emitted]  vendor
                            core.js.map     235 kB       2  [emitted]  core.js
                             index.html  413 bytes          [emitted]  
chunk    {0} bundle.js, bundle.js.map (bundle) 1.89 kB {2} [rendered]
    [0] multi bundle 64 bytes {0} [built] [1 error]
   [55] (webpack)-dev-server/client?http://0.0.0.0:8080 1.82 kB {0} [built]
chunk    {1} vendor.js, vendor.js.map (vendor) 374 kB {2} [rendered]
    [0] multi vendor 52 bytes {1} [built]

I got the following configuration, running OSX 10.11

$ npm -v
2.10.0

$ node -v
v0.12.2

Thanks for your time :)

cant get file

When i install everything and run npm run server page is coming blank. no error is coming in console.

Thanks & Regards
G M Chaturvedi
[email protected](purchased email)

Did you use any Design pattern?

Currently, I am developing one chat application similar to this, but I am not sure which design pattern to adapt. Do you have any suggestion?

Where is ng-book?

I purchased ng-book a while back but have since lost the links to how to download it. Where is it?

Error when running karma start

After running npm install in rxjs/chat, I run karma start and get the following error:

ERROR in /home/rydertana/Documents/Practice/manuscript-35/code/rxjs/chat/node_modules/@angular/core/testing/test_component_builder.d.ts
(74,57): error TS2304: Cannot find name 'Promise'.

ERROR in /home/rydertana/Documents/Practice/manuscript-35/code/rxjs/chat/node_modules/@angular/core/testing/component_fixture.d.ts
(77,19): error TS2304: Cannot find name 'Promise'.

ERROR in /home/rydertana/Documents/Practice/manuscript-35/code/rxjs/chat/node_modules/@angular/http/src/url_search_params.d.ts
(46,16): error TS2304: Cannot find name 'Map'.

ERROR in /home/rydertana/Documents/Practice/manuscript-35/code/rxjs/chat/node_modules/@angular/http/src/headers.d.ts
(45,59): error TS2304: Cannot find name 'Map'.

ERROR in /home/rydertana/Documents/Practice/manuscript-35/code/rxjs/chat/node_modules/@angular/router/src/router.d.ts
(188,43): error TS2304: Cannot find name 'Promise'.

(...)

The output goes on quite a bit, and the tests run fine. Since the tests run fine, is there a way I can at least suppress all of these errors?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.