nearley icon indicating copy to clipboard operation
nearley copied to clipboard

docs suggest installing globally and shouldn't

Open msimerson opened this issue 3 years ago • 1 comments

On the Getting started page, it says:

To use the nearley compiler, you need to additionally install nearley globally.

and shows: npm install -g nearley.

Since a few years back when npx shipped, there's a much better way to run the nearly scripts: npx nearley-{test|unparse|railroad}. The docs should be updated to suggest that instead.

msimerson avatar Mar 24 '22 17:03 msimerson

Is there a way to install it locally and have an npm script be able to run nearleyc? I installed via npm install --save-dev nearley and then have a script "compile-expression-grammar": "nearleyc path/to/grammar.ne -o path/to/grammar.js" but running npm run compile-expression-grammar fails with /var/folders/2p/3f9_b05n3hvc2yxnzqwwswmm0000gp/T/compile-expression-grammar-9adeceb5.sh: line 1: nearleyc: command not found

msfeldstein avatar Jan 19 '23 04:01 msfeldstein