antfu-collective / ni

💡 Use the right package manager
MIT License
6.54k stars 214 forks source link

nx alias conflict with nx workspaces #118

Closed mcmxcdev closed 1 year ago

mcmxcdev commented 2 years ago

Describe the bug

Unfortunately there is a conflict with https://nx.dev/ which leads to this message on install:

$ npm i -g @antfu/ni

added 1 package, and audited 2 packages in 476ms

found 0 vulnerabilities
Volta error: Executable 'nx' is already installed by nx

Please remove nx before installing @antfu/ni

Reproduction

-

System Info

System:
    OS: Linux 5.15 Manjaro Linux
    CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
    Memory: 25.70 GB / 30.73 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.volta/tools/image/node/18.12.1/bin/node
    Yarn: 1.22.19 - ~/Webdevelopment/Freelancing/myZorro/zorro/node_modules/.bin/yarn
    npm: 8.19.2 - ~/.volta/tools/image/node/18.12.1/bin/npm
  Browsers:
    Brave Browser: 107.1.45.127
    Firefox: 107.0

Used Package Manager

pnpm

Validations

wll8 commented 1 year ago

Perhaps modifying the name of nx and then installing is the best solution, such as modifying nx to nxx

# download ni
npx getcdn @antfu/ni

# change ni, nx => nxx, win: wsl sed ...
sed -i 's/"nx":/"nxx":/' ./cdn/@antfu/ni/package.json

# install ni
npm i -g ./cdn/@antfu/ni

# use nx, eg: ni -v
nxx ni -v
joaosamouco commented 1 year ago

Hi :wave:

Also being affected by this. What about changing the command from nx to something like nix and those who want to use it as nx can create an alias to it?

cirocfc commented 1 year ago

Same problem here. It would be great to update nx to nix as suggested by @joaosamouco or nxx... or basically whatever does not conflict with Nx

joaosamouco commented 1 year ago

Created #134 that implements the change from nx to nix if you guys agree. If you want to use something else instead of nix, I can update the PR :+1: