Background
I have an NodeJS oclif CLI named "mydemo" and ran npm link
to register and execute the program's commands globally. After I ran npm unlink mydemo
to unregister the command, when I type the program's name, I get the error below.
$ mydemo
bash: /home/eric/.nvm/versions/node/v15.8.0/bin/mydemo: No such file or directory
Expected output
$ mydemo
mydemo: command not found
Question
How does Linux still know to look in the ".nvm" directory for this command if I've unlinked it?
Attempts to figure it out
- Ran
npm unlink
- Ran
npm uninstall -g mydemo
- Ran
which mydemo
(no output) - Searched for symlinks (maybe I didn't search the right place)
... it still searches that specific ".nvm" directory.
Environment
- Ubuntu 20
- nvm 0.37.2
- node v15.8.0
- "@oclif/dev-cli": "^1.26.0"
Nevermind. The command was cached in the shell session, possibly in the $PATH variable. It cleared in a new user session.