Closed ChuksFestus closed 3 years ago
Can you share the output of the command? I'd like to be sure that Yarn 1.12 is being used. My guts tell me that maybe your 1.12 binary is somehow shadowed by a different, older Yarn.
Other possibility: are you on Windows, by any chance?
ok here
I mean ... you basically removed from your screenshot the only part I'm interested in ... π
Cf the following screenshot, where the Yarn version is clearly reported by create-react-app. This is what I need to see, not yarn -v
(which might not be picked up by create-react-app
for some reason):
lol ok
Wait, isn't the whole point that you wouldn't use npx and instead would use yarn for this? (wrong) If you do npx create-react-app
then you are effectively using npm to install create-react-app. From there create-react-app just uses whatever package manager was used to install it. (/wrong) Correct me if I am wrong (I have been corrected), but, --use-pnp doesn't magically tell CRA to use yarn. Can you try (edit) yarn create react-app my-app --use-pnp
?
Whoops I mean yarn create react-app my-app --use-pnp
.
From there create-react-app just uses whatever package manager was used to install it.
No, CRA will detect whether yarnpkg
exists on the system, and use it if it's there.
@jimthedev you can't really do yarn create-react-app myapp
actually
@gaearon Thank you for clearing that up. I've edited my post accordingly.
@ChuksFestus I wasn't using that command. Yarn has a create command which is similar to npx although the syntax is slightly different (note the lack of a hyphen). With that said, it seems that --use-pnp isn't working with it either. Here are the ones I was trying (and their output):
Naturally yarn create is not the same as npx but whoever takes this on might also want to test with that slightly different syntax too.
yeah thats the thing @jimthedev don't know why there's a node_module
@ChuksFestus What's inside? Some packages sometimes use the node_modules
to contain some kind of cache, so even if it exists it doesn't mean Yarn actually uses it.
@arcanis I can't speak for @ChuksFestus but in the case of yarn create react-app pnp-app --use-pnp
it is the entire world:
@arcanis same with @jimthedev
Unfortunately I can't reproduce it, and got multiple reports that it was working, so I'm not sure how to help you. My best guess is that one of the tools in the pipeline (either yarn
or create-react-app
or react-scripts
) isn't up-to-date, but I'm not sure which one. Yarn looks fine, so I'd think it's one of the two others.
Ok a few things:
Ignoring npx
and yarn create
for a second, I think something broke with pnp between 2.0.2 and 2.0.3.
Here is me just bumping from 2.0.2 to 2.0.3 of CRA and looking for installConfig in the package.json.
Somewhat related, I think there is going to be another issue introduced in 2.0.4 with this version check. Specifically the semver library won't parse nightly versions of yarn without dropping everything after the last period. Here it is in an example using my actual yarn version.
Yep ok I think that is it perhaps. There was simply something wrong in 2.0.3. @ChuksFestus can you confirm by trying npx create-react-app@2.0.2 pnp-app --use-pnp
And just a heads up that I have not tried using yarn create
because I haven't found how to do is using a specific version like npx does. If npx will use yarn as @gaearon mentioned then I'll forego that option in favor of npx.
oh.... thats probably it @jimthedev just tried it and no node_modules well the .pnp folder cos with lots of dependences tho but thats progress π
Closing as this has most likely been fixed now
so i decided to try pnp after @gaearon tweet about it and i still get node_modules
comand:
npx create-react-app --use-pnp
yarn version: 1.12.0