-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug?]: yarn dlx -p not working with package.json scripts #6500
Comments
To quote
By using
When you are in a project, simply |
@clemyan Hi, it's a common practice to create multi-stage Dockerfiles, where in one stage, we download all dependencies, and in the next, remove those not needed for production. e.g If you simply use My usage isnt replacement for yarn add, but more of a substitute for the old yarn add --global functionality. For example, in Yarn 1, it was common to install packages like Nest.js and the TypeScript CLI solely for the build process. Not doing so with the new Yarn setup can result in unnecessarily large images .
|
We have
Again, for this kind of packages, installing globally is problematic because of non-reproducible builds ("works on my machine"). Ever since If a package is used in a project by multiple developers or across multiple environments (including across host/container), then it almost certainly belongs in |
@clemyan Term "devDependencies" has a clear meaning , these are "developement" dependencies , and clearly it's not called "buildDependencies" . |
Sounds like you want a new kind of "buildDependencies" between production and dev?
Using less packages means more security, but just because it is not in your
The final image only contains production dependencies either way, so that's moot.
Yes, we are comparing a lot of thing/usecases/options here. Let's establish some baselines here:
Here are where each option stands across various metrics:
And, for a nice summary:
Given that
I don't think any of those three would fit in Yarn's core offering. That said, there are a few options you can consider: Just use
|
Self-service
Describe the bug
If I use
yarn dlx -p [email protected] build
with this package.json scripts sectionI get this error :
What I'm trying to do is to find a replacement for
yarn global add
from yarn v1 without installing all dev dependencies in order to build a projectTo reproduce
clone this repository https:/uchar/yarnbugs/tree/yarn_dlx_error , move to branch
yarn_dlx_error
Then run
if you use
RUN yarn dlx -p [email protected] tsc
instead ofRUN yarn dlx -p [email protected] build
it starts working.Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: