soroban-cli
soroban-cli copied to clipboard
TS Bindings: check if has NPM, throw useful error + instructions
trafficstars
Reported by a user:
After running
bindings typescriptit 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