Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for local deploy #233

Closed
CristianCantoro opened this issue Nov 17, 2018 · 4 comments
Closed

Add documentation for local deploy #233

CristianCantoro opened this issue Nov 17, 2018 · 4 comments

Comments

@CristianCantoro
Copy link

@CristianCantoro CristianCantoro commented Nov 17, 2018

Hi,

I am trying to run algorithm-visualizer locally, but I am not very expert in running Node.js applications. So, it would be of great help for me if the local deployment process would be documented. Here's what I have tried to do, noting that I get an error at the end.

  1. I have cloned the project and cd into the directory: git clone https://github.com/algorithm-visualizer/algorithm-visualizer.git && cd algorithm-visualizer

  2. I use nvm to manage my Node.js installation. I have done npm install and the npm run build (see the full log)

  3. I run ./bin/www (see the full log)

Finally I get this error:

/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:1483
  languages[LANG].build().catch(function () {
                  ^

TypeError: Cannot read property 'build' of undefined
    at Object.<anonymous> (/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:1483:19)
    at __webpack_require__ (/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:21:30)
    at Object.defineProperty.value (/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:85:18)
    at Object.<anonymous> (/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:88:10)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
Unhandled rejection Error: npm WARN deprecated babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! 
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

clean-webpack-plugin: /home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin has been removed.
/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:1483
  languages[LANG].build().catch(function () {
                  ^

TypeError: Cannot read property 'build' of undefined
    at Object.<anonymous> (/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:1483:19)
    at __webpack_require__ (/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:21:30)
    at Object.defineProperty.value (/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:85:18)
    at Object.<anonymous> (/home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin/build:88:10)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

    at /home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/build/backend/index.js:1:6251
    at ChildProcess.exithandler (child_process.js:282:5)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

If I go to http://localhost:8080 tehe interface is there, but it does not run, for example I get this:
graph search - bfs - mozilla firefox_145

Thanks for the great project and thanks in advance for your help.

@64json
Copy link
Member

@64json 64json commented Nov 18, 2018

Hi Christian,

I've been working on rewriting the entire project for major changes, and I regret to tell you that I may not be able to write documentation for local deployment and contribution until I finish rewriting it.

I haven't tested running it on Linux though, based on your log, the error seems to be caused by process.env.LANG having an inappropriate value. It should have either undefined or '' in order to work properly. I believe it is because Linux already uses the environmental variable LANG, so I may need to change the code to use another unique variable name than LANG. I will get back to you once I fix it in a few days.

Thank you for letting me know.

@CristianCantoro
Copy link
Author

@CristianCantoro CristianCantoro commented Nov 20, 2018

Hi @parkjs814,

I've been working on rewriting the entire project for major changes, and I regret to tell you that I may not be able to write documentation for local deployment and contribution until I finish rewriting it.

It's ok, thanks for your help.

I haven't tested running it on Linux though, based on your log, the error seems to be caused by process.env.LANG having an inappropriate value. It should have either undefined or '' in order to work properly. I believe it is because Linux already uses the environmental variable LANG, so I may need to change the code to use another unique variable name than LANG. I will get back to you once I fix it in a few days.

I have uset the env variable LANG:

$ unset LANG

The installation goes further, but I still get an error (see the full log):

--2018-11-20 01:03:36--  https://github.com/nlohmann/json/releases/download/v3.1.2/json.hpp
Resolving github.com (github.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address 'github.com'
The command '/bin/sh -c wget -O /usr/include/json.hpp https://github.com/nlohmann/json/releases/download/v3.1.2/json.hpp' returned a non-zero code: 4
Unhandled rejection Error: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

clean-webpack-plugin: /home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/src/backend/public/tracers/bin has been removed.
The command '/bin/sh -c wget -O /usr/include/json.hpp https://github.com/nlohmann/json/releases/download/v3.1.2/json.hpp' returned a non-zero code: 4

    at /home/cristian/data/extra/algorithm-visualizer/algorithm-visualizer/build/backend/index.js:1:6251
    at ChildProcess.exithandler (child_process.js:296:5)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

If you think it would not be useful to keep debugging this and I should wait for your rewrite, let me know.

Thank you!

@zmwxiaoming
Copy link

@zmwxiaoming zmwxiaoming commented Dec 3, 2018

yes? how to run

@64json
Copy link
Member

@64json 64json commented Dec 5, 2018

Hi @CristianCantoro and @zmwxiaoming, I just finished testing on Ubuntu 18.04 and fixed errors including the one @CristianCantoro mentioned. Thanks for waiting! Also, I will be working on writing documentation soon.

64json added a commit that referenced this issue Dec 9, 2018
@64json 64json closed this in d2df836 Dec 9, 2018
64json added a commit that referenced this issue Dec 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.