avh4 / binwrap

Distribute binaries via npm
39 stars 17 forks source link

binwrap crashes when upgrading package #28

Closed MorganPersson closed 5 years ago

MorganPersson commented 5 years ago

After upgrading ava, elm & elm-test to the latest versions yarn upgrade some_internal_package fails with

ERR { Error: EEXIST: file already exists, mkdir '/Volumes/Development/code/project_folder/node_modules/elmi-to-json/unpacked_bin'
    at Object.mkdirSync (fs.js:752:3)
    at /Volumes/Development/code/login/node_modules/binwrap/binstall.js:45:8
    at new Promise (<anonymous>)
    at untgz (/Volumes/Development/code/login/node_modules/binwrap/binstall.js:21:10)
    at binstall (/Volumes/Development/code/login/node_modules/binwrap/binstall.js:11:12)
    at install (/Volumes/Development/code/login/node_modules/binwrap/install.js:20:10)
    at Object.install (/Volumes/Development/code/login/node_modules/binwrap/index.js:14:14)
    at Object.<anonymous> (/Volumes/Development/code/login/node_modules/binwrap/bin/binwrap-install:18:9)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
  errno: -17,
  syscall: 'mkdir',

The some_internal_package also has some updated packages, but that package has no code or dependencies related to elm.

harrysarson commented 5 years ago

Hi, this pull is very similar to #30.

In fact it uses the approach originally used in #30 but I pointed out some concurancy issues so @henricavalcante swapped this out for another approach. Have a look at #30 - would be great to hear what you think!

avh4 commented 5 years ago

Thanks! This was merged via https://github.com/avh4/binwrap/pull/32 using the solution in #30 for the reasons harrysarson described (it's the recommended way to do it according to the node fs docs).