Skip to content

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

@TommyMurphyTM1234

Description

@TommyMurphyTM1234

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions