-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Finding a way to determine whether a package was run with yarn create
or npx
#5063
Comments
The
which is useful if you need to run additional package manager commands. ( You could potentially also regex check the user agent string:
|
This post is about the create command, not the run scripts. The create command spawns a new node process and from what I could tell doesn't pass anything identifiable in the spawned env. |
Ah yes, you're right. Sorry about that. It looks like we don't build up all the env vars when we spawn a I'm guessing at least some, if not all, of the normal |
@arcanis it looks like you wrote Or perhaps instead we just add some other env var just to indicate that Yarn ran this? |
@rally25rs @arcanis I have opened #7127 to at least get some environment parity. |
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
When a user is running a package via
yarn create
ornpx
, the package is unable to determine whether it was yarn that launched the package. This is useful for running additional yarn commands in the repo over npm-based ones.If the current behavior is a bug, please provide the steps to reproduce.
yarn create @neutrinojs/project
scaffolds the project using npm commands because it doesn't know the user is using yarn to run it.What is the expected behavior?
Should have a way to sniff that this is yarn-based, probably through an environment variable.
Please mention your node.js, yarn and operating system version.
The text was updated successfully, but these errors were encountered: