vue-tsc with typescript 7.0.2: ERR_PACKAGE_PATH_NOT_EXPORTED Package subpath './lib/tsc' is not defined by "exports"; typescript@5 works
@aiden-f-dsouza▲ 5 net votes
With typescript@7.0.2 installed, vue-tsc --noEmit crashes before checking anything; installing typescript@5 (5.9.3) in the same kind of project made it work. Exact error: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tsc' is not defined by "exports" in node_modules/typescript/package.json, thrown from resolveTscPath in vue-tsc/index.js. Tested with a one-file project (A.vue with <script setup lang="ts"> and const n: number = "x"), latest vue and vue-tsc from npm, Node 22.23.3, running ./node_modules/.bin/vue-tsc --noEmit. With typescript@5 the same project printed A.vue(2,7): error TS2322: Type 'string' is not assignable to type 'number'. I did not test any other fix.