launchcodedev / app-config

Easy Configuration Loader with Strict Validation
https://app-config.dev
Mozilla Public License 2.0
69 stars 11 forks source link

npx cli doesn't work on windows #205

Closed pats closed 1 year ago

pats commented 2 years ago

Hi,

There is a problem with current implementation of CLI. Simply, on windows doesn't work.

Running in command line (PowerShell)

PS C:\Users\user\Dev\junoJs\packages\juno-config> npx @app-config/cli vars
npm ERR! could not determine executable to run

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2022-08-09T14_30_01_459Z-debug-0.log

Log details:

28 silly logfile start cleaning logs, removing 1 files
29 http fetch GET 200 https://registry.npmjs.org/@app-config%2fcli 264ms (cache revalidated)
30 timing command:exec Completed in 282ms
31 verbose stack Error: could not determine executable to run
31 verbose stack     at getBinFromManifest (C:\Users\user\AppData\Roaming\nvm\v16.13.2\node_modules\npm\node_modules\libnpmexec\lib\get-bin-from-manifest.js:17:23)
31 verbose stack     at exec (C:\Users\user\AppData\Roaming\nvm\v16.13.2\node_modules\npm\node_modules\libnpmexec\lib\index.js:115:15)
31 verbose stack     at async module.exports (C:\Users\user\AppData\Roaming\nvm\v16.13.2\node_modules\npm\lib\cli.js:66:5)
32 verbose pkgid @app-config/cli@2.8.4
33 verbose cwd C:\Users\user\Dev\junoJs\packages\juno-config
34 verbose Windows_NT 10.0.19044
35 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\nvm\\v16.13.2\\node_modules\\npm\\bin\\npm-cli.js" "exec" "--" "@app-config/cli"
36 verbose node v16.13.2
37 verbose npm  v8.3.1

None of commands described in docs works as expected.

Kind regards, PS

joelgallant commented 2 years ago

Thanks for the report! If I'm not mistaken, npx @app-config/main may work. I'll check on the difference there on the cli package.

joelgallant commented 2 years ago

Released a fix for this in v2.8.5, give it a try!

pats commented 2 years ago

Please reopen

Still doesn't work

npx @app-config/main

returns

'ac' is not recognized as an internal or external command,
operable program or batch file.

same goes to npx @app-config/cli vars

it doesn't work in powershell on windows

airtonix commented 1 year ago

does't work in wsl either.

is ac this command? https://linux.die.net/man/1/ac


sudo apt-get install apt-file
sudo apt-file update
apt-file search /bin/ac

result:

acct: /usr/bin/ac
airtonix commented 1 year ago

ok so i was complete wrong...

ac actually is supposed to come from this repo.

but if you're using yarn 3 with nodeLinker: pnpm like me, then you have to install @app-config/cli @app-config/node and then you have to run yarn app-config create -f json5 instead of npx @app-config/cli create -f json5

pats commented 1 year ago

@airtonix good point!

 pnpm --package=@app-config/cli dlx app-config vars

works great :)