patrikholcak / gitmoji

Replaces your average git log emoji strings with the real deal.
MIT License
4 stars 1 forks source link

Fails to install on OSX #1

Open zachlysobey opened 4 years ago

zachlysobey commented 4 years ago

My environment:

MacOS Mojave 10.14.5 (18F132)

▶ node -v
v12.3.1
▶ npm -v
6.9.0

I actually think I found 2 issues.

1) The README is using the wrong character for the -g

It uses an m-dash (I think) instead of a regular one. i.e. —g instead of -g.

That results in the following:

▶ npm i gitmoji —g
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "—g": Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zachlysobey/.npm/_logs/2019-10-03T21_52_43_920Z-debug.log

If you like, I can open up a small PR to update this. Also, my preference would be using the long-hand option (--global) for documentation, but that's up to you ultimately.

2) Even with that fixed, it still fails with the following. I did not attempt to debug further.

npm i -g gitmoji
/Users/zachlysobey/.nvm/versions/node/v12.3.1/bin/gitmoji -> /Users/zachlysobey/.nvm/versions/node/v12.3.1/lib/node_modules/gitmoji/index.js

> kexec@1.3.0 install /Users/zachlysobey/.nvm/versions/node/v12.3.1/lib/node_modules/gitmoji/node_modules/kexec
> node-gyp configure build

  CXX(target) Release/obj.target/kexec/src/kexec.o
../src/kexec.cc:22:30: error: use of undeclared identifier 'F_GETFD'
    int flags = fcntl (desc, F_GETFD, 0);
                             ^
../src/kexec.cc:26:15: error: use of undeclared identifier 'FD_CLOEXEC'
    flags &= ~FD_CLOEXEC; //clear FD_CLOEXEC bit
              ^
../src/kexec.cc:27:25: error: use of undeclared identifier 'F_SETFD'
    return fcntl (desc, F_SETFD, flags);
                        ^
../src/kexec.cc:69:27: error: no matching constructor for initialization of 'String::Utf8Value'
        String::Utf8Value v8str(args[0]);
                          ^     ~~~~~~~
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8.h:3002:5: note: candidate constructor not viable: no known conversion from 'Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8.h:2995:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
../src/kexec.cc:85:27: error: no matching constructor for initialization of 'String::Utf8Value'
        String::Utf8Value v8str(args[0]);
                          ^     ~~~~~~~
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8.h:3002:5: note: candidate constructor not viable: no known conversion from 'Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8.h:2995:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
../src/kexec.cc:101:77: error: no matching member function for call to 'ToString'
          String::Utf8Value arg(argv_handle->Get(Integer::New(isolate, i))->ToString());
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8.h:2528:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                           ^
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8.h:2544:35: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
                    Local<String> ToString(Isolate* isolate) const);
                                  ^
../src/kexec.cc:101:46: warning: 'Get' is deprecated: Use maybe version [-Wdeprecated-declarations]
          String::Utf8Value arg(argv_handle->Get(Integer::New(isolate, i))->ToString());
                                             ^
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8.h:3412:3: note: 'Get' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
  ^
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8config.h:322:29: note: expanded from macro 'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/kexec.cc:127:58: warning: 'NewFromUtf8' is deprecated: Use maybe version [-Wdeprecated-declarations]
    isolate->ThrowException(Exception::TypeError(String::NewFromUtf8(isolate, "kexec: invalid arguments")));
                                                         ^
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8.h:2890:10: note: 'NewFromUtf8' has been explicitly marked deprecated here
  static V8_DEPRECATED(
         ^
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8config.h:307:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/kexec.cc:133:17: error: variable has incomplete type 'void'
    static void init (Handle<Object> target) {
                ^
../src/kexec.cc:133:23: error: use of undeclared identifier 'Handle'
    static void init (Handle<Object> target) {
                      ^
../src/kexec.cc:133:30: error: 'Object' does not refer to a value
    static void init (Handle<Object> target) {
                             ^
/Users/zachlysobey/.node-gyp/12.3.1/include/node/v8.h:3356:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../src/kexec.cc:133:38: error: use of undeclared identifier 'target'
    static void init (Handle<Object> target) {
                                     ^
../src/kexec.cc:133:45: error: expected ';' after top level declarator
    static void init (Handle<Object> target) {
                                            ^
                                            ;
2 warnings and 11 errors generated.
make: *** [Release/obj.target/kexec/src/kexec.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/zachlysobey/.nvm/versions/node/v12.3.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/Users/zachlysobey/.nvm/versions/node/v12.3.1/bin/node" "/Users/zachlysobey/.nvm/versions/node/v12.3.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/zachlysobey/.nvm/versions/node/v12.3.1/lib/node_modules/gitmoji/node_modules/kexec
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kexec@1.3.0 install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kexec@1.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zachlysobey/.npm/_logs/2019-10-03T21_53_07_076Z-debug.log
patrikholcak commented 4 years ago

I haven’t used this project in ages, so if you can and want to submit a fix, it will be much appreciated. If not, I’m sorry but I’ll fix it when I get some free time for it. 🙌

zachlysobey commented 4 years ago

Won't likely circle back to it, but hopefully this issue being here might provide a little bit of value if someone else runs into the same issue

labg94 commented 4 years ago

@zachlysobey how would you fix that? i have the same issue 😢 and idk what to do to install it