avh4 / elm-format

elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
BSD 3-Clause "New" or "Revised" License
1.31k stars 145 forks source link

file already exists, mkdir '.../elm-format/unpacked_bin #602

Open avh4 opened 5 years ago

avh4 commented 5 years ago

peacememories [6:11 AM] hmm, for some reason i'm getting EEXIST errors when trying to install elm-format

"file already exists, mkdir '.../elm-format/unpacked_bin'" not sure why the unpacked_bin dir would exist already, though

av [9:59 AM] Maybe try removing it (with rm -Rf "$(npm root)"/elm-format or rm -Rf "$(npm root -g)"/elm-format) and then try installing again? (edited)

peacememories [2:05 AM] i already removed the whole node_modules folder, but it comes back every install the unpacked_bin, that is, it's pretty obvious that the node_modules folder would come back^^ i think it has something to do with npm caches when i do npm install elm-format it works, but when i do npm install it breaks

peacememories [2:15 AM] i've removed elm-format from my dependencies for now, which makes the install work again

GabeAtWork commented 5 years ago

I have the same error with yarn. I'm using it with lerna, the bootstrap fails because it re-runs some of the yarn install stuff.

mbark commented 5 years ago

I'm able to reproduce this problem consistently, but only when using yarn (if I use npm instead of yarn in the commands below it works fine).

mkdir tmp
cd tmp
yarn add elm-format
yarn add axios
yarn remove axios

This fails with:

error /private/tmp/node_modules/elm-format: Command failed.
Exit code: 1
Command: binwrap-install
Arguments:
Directory: /private/tmp/node_modules/elm-format
Output:
ERR { Error: EEXIST: file already exists, mkdir '/private/tmp/node_modules/elm-format/unpacked_bin'
    at Object.mkdirSync (fs.js:773:3)
    at /private/tmp/node_modules/binwrap/binstall.js:45:8
    at new Promise (<anonymous>)
    at untgz (/private/tmp/node_modules/binwrap/binstall.js:21:10)
    at binstall (/private/tmp/node_modules/binwrap/binstall.js:11:12)
    at install (/private/tmp/node_modules/binwrap/install.js:20:10)
    at Object.install (/private/tmp/node_modules/binwrap/index.js:14:14)
    at Object.<anonymous> (/private/tmp/node_modules/binwrap/bin/binwrap-install:18:9)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
    at internal/main/run_main_module.js:21:11
  errno: -17,
  syscall: 'mkdir',
  code: 'EEXIST',
  path: '/private/tmp/node_modules/elm-format/unpacked_bin' }