odiff icon indicating copy to clipboard operation
odiff copied to clipboard

Could not create _export folder: EEXIST: file already exists

Open alvesvaren opened this issue 3 years ago • 12 comments

I've been using this with lost-pixel, and it gives me this error sometimes when I deploy to vercel and it uses the existing node_modules folder when reinstalling dependencies:

[14:52:43.956] [4/4] Building fresh packages...
[14:52:44.436] error /vercel/path0/node_modules/odiff-bin: Command failed.
[14:52:44.436] Exit code: 1
[14:52:44.437] Command: node ./postinstall.js
[14:52:44.437] Arguments: 
[14:52:44.437] Directory: /vercel/path0/node_modules/odiff-bin
[14:52:44.437] Output:
[14:52:44.437] Could not create _export folder
[14:52:44.438] error: Error: EEXIST: file already exists, mkdir '/vercel/path0/node_modules/odiff-bin/3'
[14:52:44.439] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[14:52:52.090] Error: Command "yarn install" exited with 1

alvesvaren avatar Nov 22 '22 14:11 alvesvaren

That's unfair! I'll take a look into that ASAp

dmtrKovalenko avatar Nov 22 '22 14:11 dmtrKovalenko

Hi, having the same in vercel deploy. Something in their env?

Installed by yarn 1

TrySound avatar Nov 23 '22 16:11 TrySound

The problem is in our install script which fails on fs exists.

What I can think of the following workaround – remove all the folders on preinstall script. E.g. preinstall: "rm -rf node-modules/odiff-bin"

dmtrKovalenko avatar Nov 23 '22 17:11 dmtrKovalenko

I will work on several odiff fixes on thanksgiving weekends and will fix the issue

dmtrKovalenko avatar Nov 23 '22 17:11 dmtrKovalenko

Thanks!

TrySound avatar Nov 23 '22 17:11 TrySound

The workaround of adding "preinstall": "rm -rf node_modules/odiff-bin" to the script-section of package.json works for me, thanks

alvesvaren avatar Nov 25 '22 12:11 alvesvaren

I have upgraded to 2.5.1, but it still fails to install (exactly the same error).

I can replicate it locally by running yarn followed by yarn upgrade odiff-bin in my project directory.

The folder node_modules/odiff-bin/3 seems to be deleted when running yarn, but then when it runs yarn upgrade it tries to create the same folder again.

Folder structure in my node_modules when it fails: Screenshot_20221208_104623

It seems to fail once every other time I run yarn upgrade odiff-bin

alvesvaren avatar Dec 08 '22 09:12 alvesvaren

FWIW, I started seeing this today in our Netlify builds and once locally. We're using [email protected] (which uses [email protected]) and have been for a few weeks before seeing this for the first time.

nick-fields avatar May 03 '23 01:05 nick-fields

Need to revisit that one, workaround should help. Remove node_modules/odiff before you do npm install on CI

dmtrKovalenko avatar May 03 '23 07:05 dmtrKovalenko

The preinstall script wasn't enough for us for some reason. We use yarn, so pinning the version to 2.5.1 via the resolutions feature has worked so far

nick-fields avatar May 03 '23 11:05 nick-fields

It would be very helpful if you can create isolated repository specifically for your issue so I can debug it

dmtrKovalenko avatar May 03 '23 11:05 dmtrKovalenko

I can replicate it by initializing an empty package with yarn init, running yarn add lost-pixel and then yarn upgrade odiff-bin. This causes the last command to fail every other time.

alvesvaren avatar May 03 '23 12:05 alvesvaren