Closed leabdalla closed 10 years ago
Woops, this is indeed annoying.
Are you running the app in Node.js or in the browser? Also, which version of gRex are you using?
I'm running version 0.4.0 in NodeJS on Mavericks.
Outputting the client
object, it shows:
{ options: { database: 'graph', host: '127.0.0.1', port: 8182 },
typeMap: {},
resultFormatter: {} }
The example you're trying is an example meant for the latest gRex version i.e., 0.5.x. I hugely recommend that you get the latest version. Run:
npm install grex
To get the latest version.
Otherwise, try the old example: https://github.com/gulthor/grex/blob/0.3.1/examples/createVertex.js
I just tried it with gRex 0.4.0 and there is a small bug in src/grex.js file installed inside your nodemodules directory: Change merge to .merge like so.
Grex.prototype.begin = function (typeMap) {
typeMap = typeMap ? _.merge(typeMap, this.typeMap) : this.typeMap;
return new Transaction(this.options, typeMap);
};
Note: You also have to install the batch kibble extension... (https://github.com/gulthor/grex/tree/nodeify#dependancies).
The easiest thing you can do to get you started is installing the latest version of gRex.
Running
npm install grex
The version 0.4.0 is downloaded. Check: https://www.npmjs.org/package/grex
How can I manually install the version 0.5.0?
This is weird. It could be npm related, I don't know. I'll investigate.
Could you please try the following?
npm install grex@0.5.x
Or if you wish to automatically update package.json:
npm install grex@0.5.x --save
Let met know how it goes.
Now it worked and that errors has gone. Thanks!
npm install output:
[~/Desktop/test]$ npm install grex@0.5.x --save [ruby-1.9.3-p448]
npm WARN package.json test@0.0.0 No description
npm WARN package.json test@0.0.0 No repository field.
npm WARN package.json test@0.0.0 No README data
npm http GET https://registry.npmjs.org/grex
npm http 304 https://registry.npmjs.org/grex
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/q
npm http 304 https://registry.npmjs.org/lodash
grex@0.5.6 node_modules/grex
├── inherits@2.0.1
├── q@0.9.7
└── lodash@2.4.1
[~/Desktop/test]$
Good to hear :). Let me know if you have trouble using gRex. You can also find me on irc Freenode #tinkerpop or #mogwai as Gulthor. Feel free to drop by, I'll happily provide support.
This issue is most likely related with issue https://github.com/gulthor/grex/issues/27.
This was indeed related to #27. My local npm config was misconfigured, and that caused issues when publishing packages. It was fixed for v0.5.6 and the problem should not occur with next versions anymore.
I'm trying the example in readme file:
So, when I run app, I get this:
Am I doing something wrong?