eventOneHQ / apkup

🚀 Publish APKs to Google Play directly from the terminal
https://oss.eventone.page/apkup
MIT License
36 stars 12 forks source link

Unable to install apkup dependency with yarn 1.22 but works ok with npm 8 #58

Closed mikecfisher closed 2 years ago

mikecfisher commented 2 years ago

Hi guys I'm trying to install apkup up on my React Native app. My app uses yarn to resolve npm dependencies. However when I do yarn install on all my dependencies when the script reaches the 'apkup' part of the install it errors out. It looks like its related to bundle tool.

error /Users/mike/app/node_modules/bundletool: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /Users/mike/app/node_modules/bundletool
Output:
node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:371:5)
    at validateString (node:internal/validators:119:11)
    at Object.join (node:path:1172:7)
    at getCachedBinary (/Users/mike/app/node_modules/bundletool/install.js:90:26)
    at setupBundletool (/Users/mike/app/node_modules/bundletool/install.js:111:22)
    at Object.<anonymous> (/Users/mike/app/node_modules/bundletool/install.js:128:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)

What's odd is this works ok when I try to install with npm v8.

nprail commented 2 years ago

Looks like this is due to bundletool's use of process.env.npm_config_cache which I am guessing isn't available when run with Yarn. I would recommend creating an issue on bundletool's repo.

https://github.com/Ribeiro-Tiago/bundletool/issues

This is specifically where the issue is: https://github.com/Ribeiro-Tiago/bundletool/blob/master/install.js#L91

mikecfisher commented 2 years ago

Hey @nprail I opened a ticket on bundle tool's repo and they've released a fix and a new version. Do you think you guys could pull in this new version?

https://github.com/Ribeiro-Tiago/bundletool/issues/11

nprail commented 2 years ago

Yup, I'll get a new version out with that fix shortly!

mikecfisher commented 2 years ago

Thanks Noah!

nprail commented 2 years ago

:tada: This issue has been resolved in version 1.3.2-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: