scottrogowski / code2flow

Pretty good call graphs for dynamic languages
MIT License
3.92k stars 286 forks source link

Acorn is installed but code2flow still doesn't work #74

Closed manipulative closed 1 year ago

manipulative commented 1 year ago

Hell Scott~ I installed code2flow and it works well on python scripts. However, when I want to generate plot of javascript scripts, it returns

Traceback (most recent call last):
  File "/opt/homebrew/bin/code2flow", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/engine.py", line 860, in main
    code2flow(
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/engine.py", line 734, in code2flow
    file_groups, all_nodes, edges = map_it(sources, language, no_trimming,
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/engine.py", line 462, in map_it
    language.assert_dependencies()
  File "/opt/homebrew/lib/python3.10/site-packages/code2flow/javascript.py", line 250, in assert_dependencies
    assert is_installed('acorn'), "Acorn is required to parse javascript files " \
AssertionError: Acorn is required to parse javascript files but was not found on the path. Install it from npm and try again.

I think I correctly installed Acorn in my home path. Shall I install Acorn in code2flow path?

manipulative commented 1 year ago

installed in global mode fix this problem, thanks~