node.jsnpmsymlinknpm-linkoclif

Where is `npm link` registring commands on Ubuntu?


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

... it still searches that specific ".nvm" directory.

Environment


Solution

  • Nevermind. The command was cached in the shell session, possibly in the $PATH variable. It cleared in a new user session.