dmtrKovalenko / odiff

The fastest pixel-by-pixel image visual difference tool in the world.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not create _export folder: EEXIST: file already exists

alvesvaren opened this issue · 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

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

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

Installed by yarn 1

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"

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

Thanks!

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

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

FWIW, I started seeing this today in our Netlify builds and once locally. We're using lost-pixel@3.2.0 (which uses odiff-bin@2.5.0) and have been for a few weeks before seeing this for the first time.

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

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

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

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.