Search code examples
npxbit.devvolta

How to undo what was executed from an npx command package?


I installed bit on my Ubuntu 22.04 machine using npx @teambit/bvm install, which created an executable in my HOME/bin folder and an entry on my .zshrc

Now, I would like to know if anything else was installed, and how can I completely remove Bit from my machine.

Ideally, I would like to know which code was run when doing npx @teambit/bvm install

I use volta to install nodejs https://volta.sh/


Solution

  • Answering this question requires some context.

    First and foremost, @teambit/bvm produces side-effects in the ~/.bvm/ directory (see code here - https://github.com/teambit/bvm). To delete Bit and BVM completely, you need to manually remove that directory.

    In general, npx doesn't have a way to revert side effects by packages/commands you run through it (if they do produce any side effects). There's no way to get npx to undo what any tool did, as npx doesn't force any boundaries on tools.
    At the end of the day, you need to delete each tool per to its own instructions.

    The only thing that npx does is creating the ~/bin/bvm (in the case of @teambit/bvm, for other tools naming will be different). This is a shortcut for the command that the package-manager puts in place. It's unrelated to bvm or bit. npx may also place things in global node_modules or do other npm-related things.