Couldn't find preset "es2015"
This seems like the furthest along project for JavaScript call graph visualization. If there is another one you recommend over this, please let me know. Otherwise, I am running it on some source code that I am analyzing, and I am seeing this error.
$ callgraph index.js
Processing index.js
[Error: Couldn't find preset "es2015" relative to directory "/Users/my-name/my-project/lib"]
[TypeError: S.input is not a function]
Success! Check callgraph.png
And although the success message was displayed, and although the file callgraph.png has been generated, it is blank.
By the time I started this repo, there weren't any good solutions out there.
I could not reproduce your error.
How did you install it?
It seems your installation is missing a npm install.
I have the same problem when I install callgraph globally. Babel is looking for es2015 presets on the current directory while it should look for it on the global directory.
I think you should define presets with an absolute path here instead of just es2015.
I have the same problem when I install it by npm install -g callgraph (npm 2.15.11, node 4.4.7)
It works if I do this in the directory of the file I want to analyse :
npm install --save-dev babel-cli babel-preset-es2015
echo '{ "presets": ["es2015"] }' > .babelrc
npm install -g babel-preset-es2015 + having a path to global modules in my NODE_PATH solved the issue for me. Maybe you can experiment with NODE_PATH environment variable in your module...
Adding globally installed callgraph's node_modules directory to NODE_PATH, without having to install anything else, or creating a .babelrc file, solved this issue for me.
For example, on Windows:
export NODE_PATH='C:\node-v10.15.3-win-x64\node_modules\callgraph\node_modules'

