Can't deploy a TypeScript app: tsc not found

Hello! I have a simple Vite (React + Typescript) app I'm trying to deploy on Cloudflare Pages. I have my git repo hooked up, but when I push, the dependencies all install correctly, it correctly runs npm run build, and I then get sh: 1: tsc: not found.
5 Replies
mdierker
mdierker9mo ago
"typescript": "^5.0.2", is in my package.json and I've tried it in both devDependencies and regular dependencies.
mdierker
mdierker9mo ago
Full deploy log from a sample deployment
mdierker
mdierker9mo ago
Any tips? lol -- after hours of debugging, the problem was that I was using the default npm run build when it should have been yarn build. 🤦‍♂️ Works on my local machine presumably because I have global TypeScript installed. TIL those aren't equivalent.
Hello, I’m Allie!
Are you using yarn in your project? If so, then I don’t think the builder installs NPM…
nat20sFruitBat07Dad
I think there is something else going on here. Are you saying that yarn is the only option?