question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Examples aren't working

See original GitHub issue

When running the examples I get:

guy@MSI-GS60:~/source/gremlin-javascript/examples$ node node-example
module.js:341
    throw err;
    ^

Error: Cannot find module '../'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/home/guy/source/gremlin-javascript/examples/node-example.js:1:77)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)

I created a PR to discuss this and then realized that I should have created an issue first. So this is that issue. Here is the PR: https://github.com/jbmusso/gremlin-javascript/pull/39

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
PommeVertecommented, Mar 24, 2016

Yes that is my image. I wasn’t finished with it so it only partially works (also why there’s no documentation attached). Here’s how to use it for your use case (remember to fetch it again as I’ve just made some changes) : Create a folder, lets call it custom-gremlin-server. In the folder place any files you want to change on the server by following the same folder structure. For example you want to use gremlin-server-js.yaml. So place that file at custom-gremlin-server/conf/gremlin-server.yaml

Then run the docker container with the following (remember to change the custom-gremlin-server path):

sudo docker run -d --name testing-gs -v /full/path/to/gremlin-server-custom:/gremlin-server/conf dmillgremlin/gremlin-server:3.1.1
  • -d run as daemon in the background. You can omit this if you want to see the log output
  • –name the name of the container so you can easily stop / remove it later.
  • -v mount your local folder into the container
  • dmillgremlin/gremlin-server:3.1.1 use gremlin-server 3.1.1 (3.1.0 also available)
1reaction
guyelliscommented, Mar 25, 2016

Thanks @PommeVerte

In case anyone else comes across this, here are some steps to use this with the Docker container:

  1. As @PommeVerte mentioned, copy the gremlin-server-js.yml file to the folder that you’re going to mount with docker and rename it to gremlin-server.yml
  2. Start the Docker container: docker run -p 8182:8182 -d --name testing-gs -v /opt/titan/conf/gremlin-server:/gremlin-server/conf dmillgremlin/gremlin-server:3.1.1
  3. Find the IP address of the container: docker inspect | grep "IPA"
  4. Edit examples/node-example.js file and add the port and IP to the createClient() command. e.g.: var client = gremlin.createClient('8182', '127.0.0.2');
  5. Run the example: npm run examples:node (assumes that PR #39 has been merged)

Result:

$ npm run examples:node

> gremlin@2.2.0 examples:node /home/guy/source/gremlin-javascript
> babel-node examples/node-example

{ id: 2,
  label: 'vertex',
  type: 'vertex',
  properties: { name: [ [Object] ], age: [ [Object] ] } }
null [ { id: 2,
    label: 'vertex',
    type: 'vertex',
    properties: { name: [Object], age: [Object] } } ]
All results fetched
Read more comments on GitHub >

github_iconTop Results From Across the Web

Use is not working properly in a sentence - Examples - Bab.la
See how to use is not working properly in a sentence. Lot of example sentences with the word is not working properly.
Read more >
Not working Definition | Law Insider
Not working means that the respondent did not work in his/her employment to be able to take care of own children. The employment...
Read more >
Dropzone js documentation example not working
I am following an example from the documentation of Dropzone.js. The example does not seem to work. This is what I have as...
Read more >
examples not working · Issue #8496 · openlayers ... - GitHub
when i copy/paste the code to a local .html file i get errors about the import statements. Also when i read the file,...
Read more >
beamer - This text is {\usebeamercolor*{example text ...
This command should display the word 'example' in green, but it prints in the normal text colour, i.e. black. beamer · color.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found