ion
ion copied to clipboard
sh: tsc: command not found
I followed cli.md
and encountered some error when npm run build
:
$ npm run build
> [email protected] build
> tsc && copyfiles "json/**/*.json" dist && copyfiles "tests/**/*.json" dist && copyfiles "tests/**/*.js*" dist
sh: tsc: command not found
Hmm, might need to install the tsc package globally? Can you try that and let me know?
I ran into this problem for the install instructions as well.
https://github.com/decentralized-identity/ion/blob/master/install-guide.md
NOTE: You may nee to run
npm install tsc
before runningnpm run build
to install TypeScript in Linux/Mac environments.
I think these instructions are incorrect. The package that provides tsc
on the command line is typescript -g
. And you need to be using the specific version used in the package.json file, which is 3.9.6
(I got build errors when I tried running on the latest). So the instructions should be run:
$ npm install [email protected] -g
Before running npm run build
. Alternatively npx
should use the version used in the dev dependencies. So the build
command in the package.json
file could be changed to:
"scripts": {
"build": "npx tsc && copyfiles \"json/**/*.json\" dist && copyfiles \"tests/**/*.json\" dist && copyfiles \"tests/**/*.js*\" dist",
To avoid having to install the correct version of tsc
globally.
avoid installing packages globally, since the global version can be different than the one assumed by package.json... use npx
and dev dependencies, and scripts in package.json.