79715610

Date: 2025-07-26 10:56:40
Score: 0.5
Natty:
Report link

Tl,dr: I had to (1) install Vercel's packages, (2) add the override field in package.json, (3) reinstall Vercel's packages. I imagine this is one of npm's sloppy implementation details at work.


The solution was actually pretty stupid and probably due to how npm manages overrides (evidently pretty poorly).

Running npm ls typescript was returning the following results for the serverless app. The typescript installs everywhere else were in the right version (5.8.2), but:


├─┬ [email protected] -> .\apps\serverless
│ └─┬ @vercel/[email protected]
│   ├─┬ [email protected]
│   │ └── [email protected] deduped
│   └── [email protected]

We can see that @vercel/node used a version of typescript that did not match what we wanted. That was the key of the issue. Now, simply adding the following overrides field in the monorepos' root level package.json did NOT work even after deleting all node_modules and rerunning npm install:

"overrides": {
  "@vercel/node": {
    "typescript": "^5.8.3"
  },
  "ts-node": {
    "typescript": "^5.8.3"
  }
}

I had go through the following sequence:

Which finally solved the issue and had ts-node rely on the correct version of typescript.

Reasons:
  • Blacklisted phrase (1): did NOT work
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: AlexAngc