Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xpm install without --global in a non-project directory generates confusing error #203

Open
TommyMurphyTM1234 opened this issue Jul 30, 2024 · 0 comments
Assignees

Comments

@TommyMurphyTM1234
Copy link

Describe the bug

xpm install ... without --global in a non-project directory generates a confusing error.

To Reproduce

mkdir test
cd test

# Note - I deliberately do not run xpm init here so the directory remains a "regular" filesystem directory and not an xPack enabled project directory

xpm install @xpack-dev-tools/riscv-none-elf-gcc@latest --verbose
xPack manager - install package(s)

Processing @xpack-dev-tools/riscv-none-elf-gcc@14.1.0-1.1...
Adding to central store 'C:\Users\Tommy Murphy\AppData\Roaming\xPacks\@xpack-dev-tools\riscv-none-elf-gcc\14.1.0-1.1'...
Extracting 'xpack-riscv-none-elf-gcc-14.1.0-1-win32-x64.zip'...
6398 files extracted in '14.1.0-1.1/.content'
Changing permissions to read-only...
error: binary xPack installed globally, next time use --global
exit(2)

Expected behaviour

Instead of the error above maybe generate a warning along the lines of...

warning: binary xPack installed globally (next time use --global) but local install was requested

(I'm not sure if "local" is appropriate nomenclature for a project based install of the xPack?

Actual behaviour

The error is a bit confusing because the installation of the package succeeded albeit only into the central store even though a "local" install was implicitly requested.

Context

  • OS Name: Windows 10
  • the output of npm doctor
npm doctor
Connecting to the registry
Ok

Checking npm version
Ok
current: v10.8.2, latest: v10.8.2

Checking node version
Ok
current: v20.16.0, recommended: v20.16.0

Checking configured npm registry
Ok
using default registry (https://registry.npmjs.org/)

Checking for git executable in PATH
Ok
C:\Program Files\Git\cmd\git.EXE

Checking for global bin folder in PATH
Ok
C:\Users\Tommy Murphy\AppData\Roaming\npm

Comments

None.

@ilg-ul ilg-ul self-assigned this Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants