scottrogowski / code2flow

Pretty good call graphs for dynamic languages
MIT License
3.98k stars 295 forks source link

Acorn is installed to path, but I can't get it to work #85

Open nicklasu opened 1 year ago

nicklasu commented 1 year ago

So I did the global install for acorn using npm install -g acorn, but I still get the following error:

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.

import code2flow code2flow.code2flow(r'C:\Users\nikke\Downloads\Netview-system-develop', r'C:\Users\nikke\Downloads\test.png')

My environment is Windows 11 set in Finnish locale, python version 3.11 (installed through Microsoft Store) and npm is version 9.5.1. Acorn is version 8.9.0 (np, package version info was retrieved with npm list -g). Code2flow is version 2.5.1.

Pyrrha commented 11 months ago

Hello,

I had the same issue this morning. Please ensure that acorn is accessible from a simple CLI call : $ acorn If it's not, then the installation didn't work properly. I used brew as recommended in official documentation. For Windows, you should use scoop.

eddbird commented 9 months ago

I am having the same issue. I could not find any solutions. I have tried installing acorn from npm and scoop with no success. This was also done in an elevated Powershell terminal to ensure no privilege issues creating hidden errors. Acorn is accessible from Powershell. All commands and relevant programs work, all PATH variables are set up correctly, and system reboots were done in this process repeatedly. I can't figure out why it isn't being found.

Environment: Windows 10 US English, Python 3.12.1, npm 10.4.0, Powershell 7.4.0, Pip 23.3.2, Code2flow version 2.5.1, Acorn v0.10.0 (from scoop install), Code2flow 2.5.1, and a partridge in a pear tree.

gorkang commented 8 months ago

Had the same issue. Solved it with:

curl https://get.acorn.io | sh

See docs: https://docs.acorn.io/install