Can't install safe-node-app (0.11.1), bindings error ref@1.3.5

I haven’t coded in months, because I don’t like working on a project that’s permanently stuck locally,
but as I understand Phase I is good enough to already show off to the public.

So I took my little ‘comments applet made in vue project’,
practically emptied package.json from dependencies because it always causes issues,
so it’s adding them one by one again…

...
  "dependencies": {
    "vue": "~2.6.10",
    "vue-i18n": "~8.15.0",
    "vue-router": "~3.1.3"
  },
  "devDependencies": {
      "@maidsafe/safe-node-app": "~0.11.1"
  },
...

..and entered `npm install` and recieve this error:

``` bash
...
/home/folaht/.cache/node-gyp/12.13.0/include/node/v8.h: Dans l'instanciation de « void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCall
backInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::WeakCallbackInfo<void>; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback
= void (*)(const v8::WeakCallbackInfo<Nan::WeakCallbackInfo<void> >&)] » :
../../nan/nan_weak.h:268:35:   requis par « void Nan::Persistent<T, M>::SetWeak(P*, typename Nan::WeakCallbackInfo<P>::Callback, Nan::WeakCallb
ackType) [with P = void; T = v8::Object; M = v8::NonCopyablePersistentTraits<v8::Object>; typename Nan::WeakCallbackInfo<P>::Callback = void (*
)(const Nan::WeakCallbackInfo<void>&); Nan::WeakCallbackType = v8::WeakCallbackType] »
../src/binding.cc:228:77:   requis depuis ici
/home/folaht/.cache/node-gyp/12.13.0/include/node/v8.h:10004:16: attention: transtypage entre types de fonctions incompatibles de « v8::WeakCal
lbackInfo<Nan::WeakCallbackInfo<void> >::Callback » {aka « void (*)(const v8::WeakCallbackInfo<Nan::WeakCallbackInfo<void> >&) »} vers « Callba
ck » {aka « void (*)(const v8::WeakCallbackInfo<void>&) »} [-Wcast-function-type]
10004 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [binding.target.mk:105: Release/obj.target/binding/src/binding.o] Error 1
make : on quitte le répertoire « /home/folaht/Nwaȥ/Êspas dû travaj/atom/Aplikêt du wêb/Livr dê visityr/node_modules/ref/build »
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.19.80-1-MANJARO
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/folaht/Nwaȥ/Êspas dû travaj/atom/Aplikêt du wêb/Livr dê visityr/node_modules/ref
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v6.0.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ref@1.3.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ref@1.3.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

For the new APIs and working against the shared vault for eg, you want to be using the safe-nodejs repo, which is currently not published on npm FYI, so you’ll need to use the repo url + tag for package.json.

There’s currently not much by way of documentation there, so you’ll have to go off of the test examples

These APIs are still not finished though, so caveat emptor and so forth :stuck_out_tongue: (though what there is will likely not change, unless we get some feedback indicating that may be necessary).

Let us know how you get on! Feedback / thoughts super welcome.

1 Like

Good to have company @folaht! I can probably help a bit with figuring out the new API as I have used some of it.

One area I don’t think is covered in the examples Josh is connecting to the network. The code I’m using is I think correct, but maybe not as I’m also having a problem when I try to write to the network. Anyway the code is here, in an issue that also explains the problem.

As well as the test examples Josh pointed to, I’ve found native/src/lib.rs useful. It’s in Rust, but helped me discover the parameters for logging in.

If you get to the point of using the API I’ll be happy to try and help.

Be aware though that the unannounced SAFE Browser 0.15.2 release appears to have some problems so I’m sticking with 0.15.1 for now. :wink:

Good luck!

1 Like