#`tsc --noEmit --skipLibCheck` gives errors from `node_modules`, but `npx tsc --noEmit` doesn't

1 messages · Page 1 of 1 (latest)

fading flax
#

Title pretty much sums it up. Why does this happen?

eternal reef
#

As written, the first command is using a globally installed version of tsc, not the project local one, which might be a different version and have different behavior

fading flax
#

How do I make it use the local one? Is that what npx does?

eternal reef
#

Yeah. npx is one of the ways to use a local version. (Some people prefer npm exec because npx will fall back on trying to install the package if it doesn't find it, which may not be what you want)

#

scripts in your package.json also implicitly use locally installed dependencies, so if you make a "tsc": "tsc" script, then npm run tsc will run the local copy of tsc. (This is what I usually do)

fading flax
#

Ohhhhhh