Skip to content
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

Running yarn to install my packages - some files not being pulled into the package directory #3169

Open
m-andrew-albright opened this issue Apr 17, 2017 · 12 comments

Comments

@m-andrew-albright
Copy link

m-andrew-albright commented Apr 17, 2017

Do you want to request a feature or report a bug?

Bug

What is the current behavior?
The datatables.net-dt package is installed in my node_modules package directory, missing several files.

If the current behavior is a bug, please provide the steps to reproduce.

On my machine, every time I run yarn or yarn add datatables.net-dt the package is installed without several necessary files.

What is the expected behavior?
The package would be installed with all the files it contains in NPM's registry.

Please mention your node.js, yarn and operating system version.
Node: 7.5.0
Yarn: 0.22.0
Windows: 10:
image

--

I checked the cache on my machine, and all the files are there, but in my node_modules, several files are missing. The expected files in my cache:
image

The actual directory contents in ./node_modules/datatables.net-dt:
image

This causes me to have to copy the files over every time yarn runs.

I will be glad to supply any additional logs / details that might be helpful in this issue.

edit updated version

@ninjasort
Copy link

+1 I get the same behavior. It's unexpected.

@jmandzik
Copy link

We've had two people on my team have this exact issue (macOS). The files are present in the cache, but yarn (0.21, 0.22, & 0.23) only brings some of the files to the corresponding node_modules folder. Interestingly, it was even the same package and missing files for the two engineers.

I cannot reproduce locally, but we're working around it locally with manual npm install of the 1/2 installed package.

@timthomp
Copy link

timthomp commented Apr 27, 2017

False alarm for my part. The problem was that my yarn cache was incomplete for some reason. I cleared my cache and it worked fine.

+1 also getting this behavior with an local eslint plugin we install install from the file system.
Also Windows 10 professional.
"devDependencies": {
...
"eslint-plugin-xmatters": "file:../eslint-plugin-xmatters",
...

@m-andrew-albright
Copy link
Author

This is still prevalent for me and very annoying. We are about to switch back to npm because of this issue. If anyone knows a workaround, please let me know. Manually npm i datatables.net-dt every time I yarn is not fun.

@m-andrew-albright
Copy link
Author

Still happening for me in 0.24.6

I determined that it is copying all the files over properly, but then during step [5/5] Cleaning modules... some of the files are removed.

@matthiasg
Copy link

matthiasg commented Jun 7, 2017

Same is happening with just running yarn install vue .. the resulting node_modules/vue folder is missing all script files in node_modules/vue/dist. Only the README is downloaded.

This reminds me of an error in a decompression library I once used

PS: node 8, yarn 0.24.6, win10

@niccofyren
Copy link

Im pretty sure this issue is caused by the yarn module cleanup step as @m-andrew-albright mentioned.

To fix:

  1. Check your project directory for a file named: .yarnclean
  2. Delete the file, or uncomment any suspect entries
  3. Try a clean yarn install, yarn install --force, or similar

The source of the .yarnclean file in questions seems to be running the yarn clean command. The file includes a list of file/directory patterns that gets cleaned after every yarn install as long as the file is present.

Related discussion about renaming the clean command to something that better reflects what it actually does: #2438

@imsurinder90
Copy link

imsurinder90 commented Jul 4, 2017

The above solution worked for me!! 👍
I commented .yarnclean file and then re-run yarn add package-name (run only for package of which images directory missing)

@matthiasg
Copy link

matthiasg commented Jul 5, 2017

At least with vue .yarnclean is not the issue. I don't have any and vue does not either.

@iamakulov
Copy link

Cleaning the cache (with yarn cache clean <package-name>) helped me here.

@ChrisEdgington
Copy link

I had this issue with semantic-ui-css, removing the .yarnclean file solved it for me.

@ThisNameNotUsed
Copy link

ThisNameNotUsed commented Jun 26, 2020

#overdoingit #toomanyoptions #don'tbemorethanyouare.

.yarnclearn is cool and all but it SHOULD NOT have so many file names/types in it by default.

I had to start using yarn because a package I was using strongly suggested it and wouldn't work without it. I had too much on my plate to find out why or study yarn. This stupid default .yarnclean bug gave me headaches for 9 FREAKING MONTHS before I finally came back with a calmer mind and more experience to figure out that it was even coming from yarn. My main package was missing images and I MANUALLY DOWNLOADED THEM AND STUCK THEM IN THERE! CAN YOU IMAGINE!????????

I suggest keeping the .yarnclean file in there by default but commenting out the whole thing then adding two comment-sentences at the top of the file explaining why the .yarnclean file is there and how to use it. i.e. "Uncomment this file and yarn [whatever commnad] to filter out these common files which are commonly included in packages by accident. This is a special and useful feature brought to you by yarn and [yadda yadda yadda]." or " A .yarnclean file is like a git .ignore file for your package manager. We've given you a list of common files that are often accidentally included in packages and unnecessarily bloat your project. Try this feature out by uncommenting this file."

I probably won't be able to convince my team not to rebuild the project form the starter-project-tutorials on up just so they don't have to use yarn because this little bug has made them lose faith in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants