SAFE NodeJS App Tutorial: Error: Could not locate the bindings file


#1

I have tried out the SAFE NodeJS App Tutorial.
It’s not working for me.

I get the following errors:

Error 1

/home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/bindings/bindings.js:88 Uncaught Error: Could not locate the bindings file. Tried:
 → /home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/build/weakref.node
 → /home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/build/Debug/weakref.node
 → /home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/build/Release/weakref.node
 → /home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/out/Debug/weakref.node
 → /home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/Debug/weakref.node
 → /home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/out/Release/weakref.node
 → /home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/Release/weakref.node
 → /home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/build/default/weakref.node
 → /home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/compiled/8.2.1/linux/x64/weakref.node
    at bindings (/home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/bindings/bindings.js:88)
    at Object.<anonymous> (/home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/lib/weak.js:7)
    at Object.<anonymous> (/home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/weak/lib/weak.js:112)
    at Module._compile (module.js:569)
    at Object.Module._extensions..js (module.js:580)
    at Module.load (module.js:503)
    at tryModuleLoad (module.js:466)
    at Function.Module._load (module.js:458)
    at Module.require (module.js:513)
    at require (internal/module.js:11)

Error 2:

Uncaught Error: [$injector:modulerr] Failed to instantiate module tripsPlanner due to:
Error: [$injector:nomod] Module 'tripsPlanner' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.6.9/$injector/nomod?p0=tripsPlanner
    at file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:116:12
    at file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:2303:17
    at ensure (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:2224:38)
    at module (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:2301:14)
    at file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:4999:22
    at forEach (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:408:20)
    at loadModules (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:4983:5)
    at createInjector (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:4900:19)
    at doBootstrap (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:1955:20)
    at bootstrap (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:1976:12)
http://errors.angularjs.org/1.6.9/$injector/modulerr?p0=tripsPlanner&p1=Err…e%2Fatom%2FCryptomint-ms%2Fnode_modules%2Fangular%2Fangular.js%3A1976%3A12)
    at file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:116:12
    at file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:2303:17
    at ensure (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:2224:38)
    at module (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:2301:14)
    at file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:4999:22
    at forEach (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:408:20)
    at loadModules (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:4983:5)
    at createInjector (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:4900:19)
    at doBootstrap (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:1955:20)
    at bootstrap (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:1976:12)
http://errors.angularjs.org/1.6.9/$injector/modulerr?p0=tripsPlanner&p1=Err…e%2Fatom%2FCryptomint-ms%2Fnode_modules%2Fangular%2Fangular.js%3A1976%3A12)
    at file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:116:12
    at file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:5023:15
    at forEach (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:408:20)
    at loadModules (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:4983:5)
    at createInjector (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:4900:19)
    at doBootstrap (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:1955:20)
    at bootstrap (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:1976:12)
    at angularInit (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:1861:5)
    at file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:34354:5
    at HTMLDocument.trigger (file:///home/folatt/Cloud/workspace/atom/Cryptomint-ms/node_modules/angular/angular.js:3488:5)
(anonymous) @ angular.js:116
(anonymous) @ angular.js:5023
forEach @ angular.js:408
loadModules @ angular.js:4983
createInjector @ angular.js:4900
doBootstrap @ angular.js:1955
bootstrap @ angular.js:1976
angularInit @ angular.js:1861
(anonymous) @ angular.js:34354
trigger @ angular.js:3488

#2

Hi,

  1. Sounds like it could be an installation problem with the bindings. Have a read of this to see if it gives you any pointers:

https://pravinchavan.wordpress.com/2013/11/08/c-binding-with-node-js/

  1. Seems to be telling you the issue in the report:

Module ‘tripsPlanner’ is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

Let me know how you get on.

David.


#3

I know it says it’s missing, but I simply did the tutorial and I don’t know where other then index.html it should be declared.


#4

Hi @Folatt,

Can I just double-check that you did this bit:

Import the SAFE API

The application will interact with the SAFE Network using the safe-node-app package, we therefore need to add it as a dependency in our package:

$ npm install @maidsafe/safe-node-app --save

Any interaction with the SAFE Network is made thru the API imported from the safe-node-app package, we do this by adding a require statement at the top of the safenetwork.js file:

const safeNodeApp = require(’@maidsafe/safe-node-app’);

Again: I’m just double-checking.

David.


#5

Apparently something went wrong with installing nvm and I ended up with the newest npm/node version again.

I solved it with this:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm install --lts

I’m no longer getting error #1 either. I have different issues, but I twill close this thread as it’s solved.