soroban-cli icon indicating copy to clipboard operation
soroban-cli copied to clipboard

TS Bindings: check if has NPM, throw useful error + instructions

Open chadoh opened this issue 1 year ago • 1 comments
trafficstars

Reported by a user:

After running bindings typescript it returns an error, "program not found". And while it does generate some typescript files, the node modules folder as well as the dish folder is missing.

This happens because right now we assume that you have Node/NPM, rather than verifying and erroring with a more useful error message.

Let's check if Node & NPM are installed and, if not, error with this explanation:

This command generates an NPM package for use with a NodeJS codebase. You need Node/NPM to build the generated package, and you'll also need it to import and use it. There are many ways to install Node; a popular way is nvm, Node Version Manager: https://github.com/nvm-sh/nvm

chadoh avatar Jul 31 '24 14:07 chadoh