-
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
Yarn 'PnP' functionality does not work on windows: You cannot require a package that is not declared in your dependencies #6860
Comments
@arcanis Do you know if there's known issues with PnP on Windows? |
No known issue, our testsuite runs on Windows as well 🤔 The error in this issue seems to point towards a regexp detecting |
Is it possible that there is some kind of clash between yarn installed trough NPM and yarn installed with windows executable? |
@nicewaytodoit can you share your |
Yes, you have git repository with entire project: https://github.com/nicewaytodoit/yarn-pnp-error During installation with --use-pnp this time I got error: So this: Aborting installation.
What succeeded is following: and then You have And bug is there still present. Now I have noticed that:
If |
Just additional info, just now I tried couple things and behavior is really strange: Config file is still pointing to 'C:\proj\YarnCache' and packages there are intact. tried again :
and folder 'C:\proj\YarnCache' is empty ... Either I am missing something or this now does not work at all ?! |
Now I have tried following:
PNP is not working ... |
tl;dr Please upgrade to Yarn 1.13 Interesting - your https://github.com/yarnpkg/yarn/blob/master/src/util/generate-pnp-map-api.tpl.js#L37 By comparison, here's the one found in your https://github.com/nicewaytodoit/yarn-pnp-error/blob/master/.pnp.js#L37 As you can see, the regex in your file doesn't support Windows paths. This has been fixed in 7f41910, which got released with the 1.13 (my bad, I forgot to include it in the changelog, hence why I didn't suggest you to upgrade before). |
I have installed version yarn 1.13 and at first attempt it is not working. Before I give up the last thing I am trying is to remove:
from package.json. And.... no luck! What about installing from scratch? Tried that as well
So, no PNP does not work. |
This Anyway, what I'm not sure is why the |
Sorry just updated my previous comment please could you check it out. |
Ok so this By any chance, are you using a system like cygwin? If so, can you try running the following command and report what it says?
|
I am trying all this with git-bash (linux shell) so may be there is issue with winpty.
|
Quick update VS Code bash failed same way CMD shell as well. You, know what? Let me debug this forking thing, so I can see what is going on and I will update you. |
Ok I think I know what is going on just need to find what is referencing wrong package: in new version that line is replaced with: And the winner is .....
Now this is odd: GitHub Master branch says that: but my package
WTF facebook ?! At the end note to myself: |
Releasing is a process that, as simple as it seems, takes time and energy. Project maintainers typically prefer to batch multiple changes into a single release to gain time that we can spend fixing actual bugs, so in that I'm not surprised 🙂 |
Currently installed:
node version: v10.15.0
yarn version: 1.12.3
react-scripts: 2.1.2
Windows 10 x64
I have tried few things to enable PnP but neither works. First I've tried enabling it on existing project and it did not work. Then installing it as new react app with:
But it still created node_module files.
After I deleted node_module files, and tried running
yarn --enable-pnp
cash was created but at the same time there was V3 and V4 folder.Still no luck. Then deleted Cache and configured
yarn config set cache-folder /c/proj/YarnCache
So config file looks like this:
(by the way I do not have a clue why is JSON config looks all unaligned and borken)
Went again into the project and again run
yarn --enable-pnp
Checked the cache, it is created successfully with all hash file keys within folder 'C:\proj\YarnCache',
When I run project
yarn start
I get following errorAdditionally I have tried deleting yarn.lock, .pnp file and folder and running again
yarn -pnp
everything went smoothly but again without luck, I am getting the same dependency error.To emphasize: Project has been created with yarn crate react-app --use-pnp
If I remove pnp option and install packages in standard way project will run perfectly fine.
I expect project to run without errors :)
Does anyone has a clue what is going on and is it yarn issue or my system configuration issue?
The text was updated successfully, but these errors were encountered: