slap-editor / slap

Sublime-like terminal-based text editor
MIT License
6.14k stars 216 forks source link

npm install -g slap@latest fails #415

Open macorifice opened 3 years ago

macorifice commented 3 years ago

Trying to install slap using npm install -g slap@latest but it gives me an error message:

npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated highlight.js@9.0.0: Version no longer supported. Upgrade to @latest
/Users/macorifice/.nvm/versions/node/v10.16.3/bin/slap -> /Users/macorifice/.nvm/versions/node/v10.16.3/lib/node_modules/slap/slap.js

> marker-index@4.0.0 install /Users/macorifice/.nvm/versions/node/v10.16.3/lib/node_modules/slap/node_modules/marker-index
> node-gyp rebuild

  CXX(target) Release/obj.target/marker_index/src/native/iterator.o
  CXX(target) Release/obj.target/marker_index/src/native/marker-index-wrapper.o
../src/native/marker-index-wrapper.cc:112:43: warning: 'Int32Value' is deprecated [-Wdeprecated-declarations]
      row = static_cast<unsigned>(js_row->Int32Value());
                                          ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8.h:2478:3: note: 'Int32Value' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
  ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/native/marker-index-wrapper.cc:118:49: warning: 'Int32Value' is deprecated [-Wdeprecated-declarations]
      column = static_cast<unsigned>(js_column->Int32Value());
                                                ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8.h:2478:3: note: 'Int32Value' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
  ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/native/marker-index-wrapper.cc:128:92: error: too few arguments to function call, expected 4, have 3
    Local<Value> result = Nan::New(is_finite_function)->CallAsFunction(Nan::Null(), 1, argv);
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                     ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8.h:3622:3: note: 'CallAsFunction' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsFunction(Local<Context> context,
  ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8config.h:416:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/native/marker-index-wrapper.cc:171:58: warning: 'Uint32Value' is deprecated [-Wdeprecated-declarations]
    return Nan::Just<MarkerId>(static_cast<MarkerId>(id->Uint32Value()));
                                                         ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8.h:2477:3: note: 'Uint32Value' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const);
  ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
../src/native/marker-index-wrapper.cc:331:46: warning: 'Int32Value' is deprecated [-Wdeprecated-declarations]
    marker_index{static_cast<unsigned>(seed->Int32Value())} {}
                                             ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8.h:2478:3: note: 'Int32Value' has been explicitly marked deprecated here
  V8_DEPRECATED("Use maybe version", int32_t Int32Value() const);
  ^
/Users/macorifice/Library/Caches/node-gyp/10.16.3/include/node/v8config.h:327:29: note: expanded from macro 'V8_DEPRECATED'
  declarator __attribute__((deprecated))
                            ^
4 warnings and 1 error generated.
make: *** [Release/obj.target/marker_index/src/native/marker-index-wrapper.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/macorifice/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 20.2.0
gyp ERR! command "/Users/macorifice/.nvm/versions/node/v10.16.3/bin/node" "/Users/macorifice/.nvm/versions/node/v10.16.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/macorifice/.nvm/versions/node/v10.16.3/lib/node_modules/slap/node_modules/marker-index
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN notsup Unsupported engine for got@5.7.1: wanted: {"node":">=0.10.0 <7"} (current: {"node":"10.16.3","npm":"6.14.8"})
npm WARN notsup Not compatible with your version of node/npm: got@5.7.1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! marker-index@4.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the marker-index@4.0.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/macorifice/.npm/_logs/2021-03-08T16_48_51_069Z-debug.log
Explosion-Scratch commented 3 years ago

Happened to me too.Here is my entire log:

Show ```bash explosion@penguin:~$ sudo npm i -g slap npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) npm WARN deprecated highlight.js@9.0.0: Version no longer supported. Upgrade to @latest npm ERR! code 1 npm ERR! path /usr/local/lib/node_modules/slap/node_modules/marker-index npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! make: Entering directory '/usr/local/lib/node_modules/slap/node_modules/marker-index/build' npm ERR! CXX(target) Release/obj.target/marker_index/src/native/iterator.o npm ERR! CXX(target) Release/obj.target/marker_index/src/native/marker-index-wrapper.o npm ERR! make: Leaving directory '/usr/local/lib/node_modules/slap/node_modules/marker-index/build' npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@7.1.2 npm ERR! gyp info using node@10.24.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3" npm ERR! gyp http GET https://nodejs.org/download/release/v10.24.0/node-v10.24.0-headers.tar.gz npm ERR! gyp http 200 https://nodejs.org/download/release/v10.24.0/node-v10.24.0-headers.tar.gz npm ERR! gyp http GET https://nodejs.org/download/release/v10.24.0/SHASUMS256.txt npm ERR! gyp http 200 https://nodejs.org/download/release/v10.24.0/SHASUMS256.txt npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/local/lib/node_modules/slap/node_modules/marker-index/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/root/.cache/node-gyp/10.24.0/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/10.24.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/10.24.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/slap/node_modules/marker-index', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' ] npm ERR! gyp info spawn make npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! ../src/native/marker-index-wrapper.cc: In static member function ‘static Nan::Maybe MarkerIndexWrapper::PointFromJS(Nan::MaybeLocal)’: npm ERR! ../src/native/marker-index-wrapper.cc:112:54: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations] npm ERR! row = static_cast(js_row->Int32Value()); npm ERR! ^ npm ERR! In file included from /root/.cache/node-gyp/10.24.0/include/node/v8.h:26, npm ERR! from /root/.cache/node-gyp/10.24.0/include/node/node.h:63, npm ERR! from ../../nan/nan.h:56, npm ERR! from ../src/native/marker-index-wrapper.cc:2: npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h:2478:46: note: declared here npm ERR! V8_DEPRECATED("Use maybe version", int32_t Int32Value() const); npm ERR! ^~~~~~~~~~ npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’ npm ERR! declarator __attribute__((deprecated(message))) npm ERR! ^~~~~~~~~~ npm ERR! ../src/native/marker-index-wrapper.cc:118:60: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations] npm ERR! column = static_cast(js_column->Int32Value()); npm ERR! ^ npm ERR! In file included from /root/.cache/node-gyp/10.24.0/include/node/v8.h:26, npm ERR! from /root/.cache/node-gyp/10.24.0/include/node/node.h:63, npm ERR! from ../../nan/nan.h:56, npm ERR! from ../src/native/marker-index-wrapper.cc:2: npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h:2478:46: note: declared here npm ERR! V8_DEPRECATED("Use maybe version", int32_t Int32Value() const); npm ERR! ^~~~~~~~~~ npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’ npm ERR! declarator __attribute__((deprecated(message))) npm ERR! ^~~~~~~~~~ npm ERR! ../src/native/marker-index-wrapper.cc: In static member function ‘static bool MarkerIndexWrapper::IsFinite(v8::Local)’: npm ERR! ../src/native/marker-index-wrapper.cc:128:92: error: no matching function for call to ‘v8::Object::CallAsFunction(v8::Local, int, v8::Local [1])’ npm ERR! Local result = Nan::New(is_finite_function)->CallAsFunction(Nan::Null(), 1, argv); npm ERR! ^ npm ERR! In file included from /root/.cache/node-gyp/10.24.0/include/node/node.h:63, npm ERR! from ../../nan/nan.h:56, npm ERR! from ../src/native/marker-index-wrapper.cc:2: npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h:3622:43: note: candidate: ‘v8::MaybeLocal v8::Object::CallAsFunction(v8::Local, v8::Local, int, v8::Local*)’ npm ERR! V8_WARN_UNUSED_RESULT MaybeLocal CallAsFunction(Local context, npm ERR! ^~~~~~~~~~~~~~ npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h:3622:43: note: candidate expects 4 arguments, 3 provided npm ERR! ../src/native/marker-index-wrapper.cc: In static member function ‘static Nan::Maybe MarkerIndexWrapper::MarkerIdFromJS(Nan::MaybeLocal)’: npm ERR! ../src/native/marker-index-wrapper.cc:171:70: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations] npm ERR! return Nan::Just(static_cast(id->Uint32Value())); npm ERR! ^ npm ERR! In file included from /root/.cache/node-gyp/10.24.0/include/node/v8.h:26, npm ERR! from /root/.cache/node-gyp/10.24.0/include/node/node.h:63, npm ERR! from ../../nan/nan.h:56, npm ERR! from ../src/native/marker-index-wrapper.cc:2: npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h:2477:47: note: declared here npm ERR! V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const); npm ERR! ^~~~~~~~~~~ npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’ npm ERR! declarator __attribute__((deprecated(message))) npm ERR! ^~~~~~~~~~ npm ERR! ../src/native/marker-index-wrapper.cc: In constructor ‘MarkerIndexWrapper::MarkerIndexWrapper(v8::Local)’: npm ERR! ../src/native/marker-index-wrapper.cc:331:57: warning: ‘int32_t v8::Value::Int32Value() const’ is deprecated: Use maybe version [-Wdeprecated-declarations] npm ERR! marker_index{static_cast(seed->Int32Value())} {} npm ERR! ^ npm ERR! In file included from /root/.cache/node-gyp/10.24.0/include/node/v8.h:26, npm ERR! from /root/.cache/node-gyp/10.24.0/include/node/node.h:63, npm ERR! from ../../nan/nan.h:56, npm ERR! from ../src/native/marker-index-wrapper.cc:2: npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h:2478:46: note: declared here npm ERR! V8_DEPRECATED("Use maybe version", int32_t Int32Value() const); npm ERR! ^~~~~~~~~~ npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’ npm ERR! declarator __attribute__((deprecated(message))) npm ERR! ^~~~~~~~~~ npm ERR! In file included from ../../nan/nan.h:56, npm ERR! from ../src/native/marker-index-wrapper.cc:2: npm ERR! ../src/native/marker-index-wrapper.cc: At global scope: npm ERR! /root/.cache/node-gyp/10.24.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(v8::Local, v8::Local)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local, v8::Local, void*)’} [-Wcast-function-type] npm ERR! (node::addon_register_func) (regfunc), \ npm ERR! ^ npm ERR! /root/.cache/node-gyp/10.24.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’ npm ERR! NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) npm ERR! ^~~~~~~~~~~~~ npm ERR! ../src/native/marker-index-wrapper.cc:348:1: note: in expansion of macro ‘NODE_MODULE’ npm ERR! NODE_MODULE(marker_index, MarkerIndexWrapper::Init) npm ERR! ^~~~~~~~~~~ npm ERR! In file included from /root/.cache/node-gyp/10.24.0/include/node/node.h:63, npm ERR! from ../../nan/nan.h:56, npm ERR! from ../src/native/marker-index-wrapper.cc:2: npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void (*)(const v8::WeakCallbackInfo&)]’: npm ERR! /root/.cache/node-gyp/10.24.0/include/node/node_object_wrap.h:84:78: required from here npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} [-Wcast-function-type] npm ERR! reinterpret_cast(callback), type); npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void (*)(const v8::WeakCallbackInfo&)]’: npm ERR! ../../nan/nan_object_wrap.h:65:61: required from here npm ERR! /root/.cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo&)’} [-Wcast-function-type] npm ERR! make: *** [marker_index.target.mk:111: Release/obj.target/marker_index/src/native/marker-index-wrapper.o] Error 1 npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2 npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:198:13) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) npm ERR! gyp ERR! System Linux 5.4.109-13833-gaa66e29d3bd5 npm ERR! gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/slap/node_modules/marker-index npm ERR! gyp ERR! node -v v10.24.0 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-04-29T12_22_02_915Z-debug.log ```

Explosion-Scratch commented 3 years ago

Dupe of #414 and #411

LeoMehraban commented 3 years ago

happened to me, too

slajerek commented 2 years ago

This project seems to be abandoned. Is there any alternative? It fails for me too.

JulesGM commented 2 years ago

the author is dead https://github.com/slap-editor/slap/issues/413

andihafner commented 2 years ago

I had the same issues. The installation fails due to incompatibilities with current node versions.

I succeeded installing and running the editor version provided here by using node lts/argon v4.9.1, which was a current version when this repo was actively maintained.

In the meantime, there is a fork which runs under node lts/gallium -> v16.16.0: https://github.com/ajstrand/slap

If you really want to run and use the depricated version of this repo, you can use the Node Version Manager which allows you to maintain different node versions side by side.