Search code examples
typescriptbuildpackage-managerstscpnpm

"ERR_PNPM_NO_SCRIPT Missing script: tsc" when I run the command "pnpm run tsc"


I'm trying to run pnpm run tsc and I get the following error

ERR_PNPM_NO_SCRIPT  Missing script: tsc

How can I solve the issue? Thank you in advance


Solution

  • pnpm is complaining that package.json doesn't have a script named tsc in the scripts section.

    Try executing it like ./node_modules/.bin/tsc instead or create an entry in the scripts section of package.json like the following snippet:

    {
      "scripts": {
        "tsc": "tsc",
        ...
      }
    }