当我使用npm安装软件包时,一切都很好
npm install -g打字稿
/usr/local/Cellar/node/10.8.0/bin/tsc -> /usr/local/Cellar/node/10.8.0/lib/node_modules/typescript/bin/tsc
/usr/local/Cellar/node/10.8.0/bin/tsserver -> /usr/local/Cellar/node/10.8.0/lib/node_modules/typescript/bin/tsserver
但是当我键入命令时,它提示找不到命令 tsc
zsh: command not found: tsc
除非使用
/usr/local/Cellar/node/10.8.0/lib/node_modules/typescript/bin/tsc test.ts
/usr/local/Cellar/node/10.8.0/lib/node_modules/typescript/bin/tsc
版本3.2.4
Syntax: tsc [options] [file...]