Skip to content
This repository has been archived by the owner on Apr 1, 2018. It is now read-only.

Issues when installing #103

Closed
benji1000 opened this issue Sep 9, 2016 · 7 comments
Closed

Issues when installing #103

benji1000 opened this issue Sep 9, 2016 · 7 comments

Comments

@benji1000
Copy link

benji1000 commented Sep 9, 2016

Hello,

I'm trying to install hack.chat on Ubuntu 16.04. Here is what I did:

sudo apt-get install nodejs npm
git clone https://github.com/AndrewBelt/hack.chat.git
cd hack.chat
npm install

And here is what I've got:

> bufferutil@1.1.0 install /home/ben/hack.chat/node_modules/bufferutil
> node-gyp rebuild

make : on entre dans le répertoire « /home/ben/hack.chat/node_modules/bufferutil/build »
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../../nan/nan.h:261:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                         ^
../../nan/nan.h:256:25: note: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                         ^
../../nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../../nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../../nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../../nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../../nan/nan.h:672:67: error: no matching function for call to ‘New(v8::Isolate*, const char*&, uint32_t&)’
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../src/bufferutil.cc:10:0:
/usr/include/nodejs/src/node_buffer.h:31:40: note: candidate: 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,
                                        ^
/usr/include/nodejs/src/node_buffer.h:31:40: note:   conversion of argument 3 would be ill-formed:
In file included from ../src/bufferutil.cc:16:0:
../../nan/nan.h:672:67: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../src/bufferutil.cc:10:0:
/usr/include/nodejs/src/node_buffer.h:43:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/usr/include/nodejs/src/node_buffer.h:43:40: note:   conversion of argument 2 would be ill-formed:
In file included from ../src/bufferutil.cc:16:0:
../../nan/nan.h:672:67: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../../nan/nan.h:676:29: 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);
                             ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../../nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
bufferutil.target.mk:92 : la recette pour la cible « Release/obj.target/bufferutil/src/bufferutil.o » a échouée
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Erreur 1
make : on quitte le répertoire « /home/ben/hack.chat/node_modules/bufferutil/build »
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:269: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 4.4.0-36-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/ben/hack.chat/node_modules/bufferutil
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:bufferutil@1.1.0 bufferutil@1.1.0 install: `node-gyp rebuild`
npm WARN install:bufferutil@1.1.0 Exit status 1
> utf-8-validate@1.1.0 install /home/ben/hack.chat/node_modules/utf-8-validate
> node-gyp rebuild

make : on entre dans le répertoire « /home/ben/hack.chat/node_modules/utf-8-validate/build »
  CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../../nan/nan.h:261:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                         ^
../../nan/nan.h:256:25: note: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                         ^
../../nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../../nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../../nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../../nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../../nan/nan.h:672:67: error: no matching function for call to ‘New(v8::Isolate*, const char*&, uint32_t&)’
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../src/validation.cc:10:0:
/usr/include/nodejs/src/node_buffer.h:31:40: note: candidate: 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,
                                        ^
/usr/include/nodejs/src/node_buffer.h:31:40: note:   conversion of argument 3 would be ill-formed:
In file included from ../src/validation.cc:15:0:
../../nan/nan.h:672:67: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../src/validation.cc:10:0:
/usr/include/nodejs/src/node_buffer.h:43:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/usr/include/nodejs/src/node_buffer.h:43:40: note:   conversion of argument 2 would be ill-formed:
In file included from ../src/validation.cc:15:0:
../../nan/nan.h:672:67: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../../nan/nan.h:676:29: 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);
                             ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../../nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
validation.target.mk:92 : la recette pour la cible « Release/obj.target/validation/src/validation.o » a échouée
make: *** [Release/obj.target/validation/src/validation.o] Erreur 1
make : on quitte le répertoire « /home/ben/hack.chat/node_modules/utf-8-validate/build »
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:269: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 4.4.0-36-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/ben/hack.chat/node_modules/utf-8-validate
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:utf-8-validate@1.1.0 utf-8-validate@1.1.0 install: `node-gyp rebuild`
npm WARN install:utf-8-validate@1.1.0 Exit status 1
hack.chat@1.0.0 /home/ben/hack.chat
└─┬ ws@0.7.2
  ├── options@0.0.6
  └── ultron@1.0.2

What am I doing wrong? Thanks for your help.

PS: I tried installing nodejs and creating a symlink for nodejs, and also nodejs-legacy. However, that did not change the situation. I think the problem comes from somewhere else.

@zeack
Copy link

zeack commented Sep 20, 2016

try npm install as root

@benji1000
Copy link
Author

Hello and thank you for your suggestion. However, it did not change a thing. I also tried uninstalling nodejs, npm, and cloning the repo into a new folder, while being a standard user, and then root. Still nothing.

I think it's problematic, because I don't have an "exotic" setup... just a Ubuntu Server 16.04...

Any other ideas?

@M4GNV5
Copy link
Contributor

M4GNV5 commented Sep 21, 2016

just try to run hack.chat, the errors are in an optional package. Even though i get those errors too hack.chat runs fine.

@AndrewBelt
Copy link
Owner

Running npm install shouldn't do anything different, and I wouldn't recommend it. It seems like an issue with bufferutil. Can you install it separately with npm install bufferutil?

@benji1000
Copy link
Author

@M4GNV5: you were right, thanks! That's a non-blocking error.

@AndrewBelt: you were also right. Installing bufferutil separately displays an error stack trace similar to the one I got when running npm install only. Apparently, this is a common issue with this package that doesn't run well on some recent versions of node.js.

My problem is "resolved" (hack.chat is working despite the error), so thanks to the both of you!

FYI, I also got deprecation warnings when trying to install the client:

npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated transformers@2.1.0: Deprecated, use jstransformer

Also, it seems that the command needs to be ran with sudo privileges, or else:

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/http-server
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/jade
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/less
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

Maybe this could be added in the install notes, since it doesn't say that it needs to be run with sudo.

@AndrewBelt
Copy link
Owner

AndrewBelt commented Sep 22, 2016

I'd recommend installing global npm packages to your home directory rather than a root directory. Add

prefix=${HOME}/.npm

to your ~/.npmrc.

@benji1000
Copy link
Author

You're right, that worked! I tried the procedure once again in my home directory, and didn't have the checkPermissions errors after I edited ~/.npmrc and then source ~/.npmrc.

I'm not familiar with nodejs, and maybe other users of your app are in this case too. Perhaps you could add a note about this in the documentation for hack.chat? Your call.

Thanks anyway!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants