-
-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The peer deps of typescript
causes it installed in production mode
#622
Comments
// @charpeni |
https://nodejs.org/en/blog/npm/peer-dependencies
So for npm 3~6, yarn 1, and pnpm with However, when |
One could maybe avoid this by adding: "peerDependenciesMeta": {
"typescript": {
"optional": true
}
} I would rather remove it completely though. Showing which TS versions you support feels like something for @sindresorhus What do you think about adding this? "engines": {
"typescript": ">=4.7"
} Eg. tools like VSCode defaults to using their own version of TS anyway, so it should be metadata that can be read explicitly by such tools rather than be inferred implicitly by an installed dependency. (Sorry for not chiming in on the earlier issues) One can use a tool like my installed-check --engine-check --engine-no-dev |
Then you have to install with |
@OpportunityLiu Is that true for optional peer dependencies as well? Not just for optional dependencies? |
In fact, for pnpm@8.5.0, I've tried: package.json {
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"typescript"
]
},
"packageExtensions": {
"type-fest": {
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
}
}
}
} .npmrc auto-install-peers=false and install with |
Do any tools use |
Chicken and the egg problem – if no one publishes it then no one uses it and vice versa. If we think there’s merit to the original issue then we could add it to help solve that issue. |
ref: #598 #606
With a
package.json
like:typescript
will be installed even if in production mode (npm install --omit=dev
,pnpm install --prod
, oryarn install --prod
).How can I omit the
typescript
package in production mode?The text was updated successfully, but these errors were encountered: