设置将成为私有模块的 TypeScript 包的正确方法是什么?

What's the proper way to setup a TypeScript package that will be a private module?

在我的 package.json 中,我有:

{
    "name": "@myapp/models",
    "version": "1.0.3",
    "description": "My Models",
    "license": "ISC",
    "main": "build/index.js",
    "types": "build/index.d.ts",
    "scripts": {
        "postinstall": "yarn build",
        "build": "yarn cache clean && tsc"
    },
    "repository": {
        "type": "git",
        "url": "git+https://github.com/shamoons/mymodels"
    },
    "dependencies": {
        "pg": "^8.2.1",
        "reflect-metadata": "^0.1.13",
        "sequelize": "^5.21.12",
        "sequelize-typescript": "^1.1.0"
    },
    "devDependencies": {
        "@types/bluebird": "^3.5.32",
        "@types/node": "^14.0.13",
        "@types/validator": "^13.0.0",
        "typescript": "^3.9.5"
    }
}

但是当我 npm install 把它放到另一个仓库时,我得到:

/bin/sh: tsc: command not found

我做错了什么?

这是由于 postinstall npm 脚本,它在您安装包后运行。