I'm using yarn version 3.2.4. I have a package.json in my root that looks like this:
{
"scripts": {
"compile": "tsc --build",
},
"devDependencies": {
"typescript": "^4.8.4"
}
}
In packages/foo, I have this package.json
{
"scripts": {
"compile": "tsc --build"
},
"devDependencies": {
}
}
When I run yarn compile
from the root, tsc compiles correctly. But this fails:
cd packages/foo
yarn compile
command not found: tsc
If I change the child packages to include typescript as a devDependency then it works.
Why aren't the devDependencies inherited from the parent package.json?