Install the precompiled package of Node.js from the official website. (I chose LTS Linux x64.)
https://nodejs.org/en/download
After extracting it, add the path to the PATH environment variable.
export PATH=$PATH:/home/stephen/Downloads/node-v18.16.1-linux-x64/bin
Install tsc
npm install -g typescript
We can use it successfully after the above steps