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

EEXIST: file already exists #1685

Closed
meesvandongen opened this issue Feb 26, 2019 · 12 comments

Comments

Projects
None yet
5 participants
@meesvandongen
Copy link

commented Feb 26, 2019

pnpm version:

2.25.6

Code to reproduce the issue:

pnpm install react-icons-kit
https://gist.github.com/meesvandongen/57cd7f2dcfb3ef87c49c10c7305da9ae

Expected behavior:

installs correctly

Actual behavior:

throws error:

EEXIST: file already exists, link 'a:\.pnpm-store\2\registry.npmjs.org\react-icons-kit\1.2.1\node_modules\react-icons-kit\icomoon\pageBreak.js' -> 'a:\Users\M\Documents\projects\test\node_modules\.registry.npmjs.org\react-icons-kit\1.2.1\node_modules\_tmp_720_dd4fe3c80a973e07babf19b0cb9955de\icomoon\pageBreak.js'

Additional information:

  • node -v prints: v11.9.0
  • Windows, OS X, or Linux?: Windows
@zkochan

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

Reproducible only on Windows. I'll try to fix this.

This happens because there are two files: pageBreak.js and pagebreak.js. Windows does not allow two files with the same name in one folder (it ignores cases).

Both npm and Yarn only unpack pagebreak.js and don't print any warnings.

@zkochan zkochan closed this in ec60d58 Mar 4, 2019

zkochan added a commit to pnpm/tarball-fetcher that referenced this issue Mar 4, 2019

@zkochan

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

🚢 2.25.7

@HGZdev

This comment has been minimized.

Copy link

commented Mar 14, 2019

Hello,
I think I encountered similar problem on Macpnpm i check-types-mini with pnpm v2.25.7 throws an error:
EEXIST: file already exists, link '..../.pnpm-store/2/registry.npmjs.org/check-types-mini/5.7.8/node_modules/check-types-mini/CHANGELOG.md' -> '....../<myProject>/node_modules/.registry.npmjs.org/check-types-mini/5.7.8/node_modules/_tmp_6508_c5ca9eec4fb492bde4b2381954df9525/CHANGELOG.md'

node: v8.10.0
MacOS: 10.14.3

@wmertens

This comment has been minimized.

Copy link

commented Mar 15, 2019

indeed there are 2 changelogs: https://unpkg.com/check-types-mini@5.7.8/

@zkochan

This comment has been minimized.

Copy link
Member

commented Mar 15, 2019

@HGZwebdesign
I did this fix only for Windows. I can make it for Mac as well.

@zkochan zkochan reopened this Mar 15, 2019

@wmertens

This comment has been minimized.

Copy link

commented Mar 15, 2019

Perhaps the fix should be to first try writing, and if you get EEXIST, stat the destination and see if it has different case, and if it does, overwrite (or not, but I'm thinking npm just overwrites)

@zkochan zkochan added the os: OSX label Mar 15, 2019

@zkochan

This comment has been minimized.

Copy link
Member

commented Mar 15, 2019

@wmertens

Perhaps the fix should be to first try writing

this is too late as we need to create an index file that will not contain the file duplicates. If the index file will contain files that are not written to the filesystem, then pnpm will always refetch the package from registry, on every installation.

@zkochan zkochan added the priority: 1 label Mar 15, 2019

@zkochan

This comment has been minimized.

Copy link
Member

commented Mar 15, 2019

After a bit more investigation I've found out that file systems may be case insensitive on any OS. Also, on Windows, some folders may be case sensitive, others no. So the store may be case sensitive while the project's node_modules may be case insensitive.


We can do feature detection in the store directory. If ~/.pnpm-store/STORE.JSON exists, then the store directory is case sensitive. This will solve most of the problems.

However, there will be an edge case when the store is case sensitive and the project/node_modules is not. For that case, we may fall back to the solution suggested by @wmertens. Try creating hard links. If hard link exists, skip it (but print a warning). This has a downside though, that the package will always be relinked from the store, as it will miss a file.

zkochan added a commit that referenced this issue Mar 16, 2019

zkochan added a commit that referenced this issue Mar 17, 2019

zkochan added a commit that referenced this issue Mar 17, 2019

@zkochan zkochan closed this in 273386c Mar 17, 2019

@zkochan

This comment has been minimized.

Copy link
Member

commented Mar 18, 2019

🚢 3.0.1

@wmertens

This comment has been minimized.

Copy link

commented Mar 18, 2019

That fix looks great, thanks!

This has a downside though, that the package will always be relinked from the store, as it will miss a file.

Those packages will then stand out and hopefully the authors will fix the case sensitivity.

@ExE-Boss

This comment has been minimized.

Copy link
Contributor

commented Apr 13, 2019

You could, on Windows 10, enable case sensitivity for the packages which have two files with different case.

See also:

@wmertens

This comment has been minimized.

Copy link

commented Apr 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.