简体   繁体   English

Ubuntu 上的“npm link”注册命令在哪里?

[英]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.我有一个名为“mydemo”的 NodeJS oclif CLI,并运行npm link以全局注册和执行程序的命令。 After I ran npm unlink mydemo to unregister the command, when I type the program's name, I get the error below.在我运行npm unlink mydemo以取消注册命令后,当我输入程序名称时,我收到以下错误。

$ mydemo
bash: /home/eric/.nvm/versions/node/v15.8.0/bin/mydemo: No such file or directory

Expected output预期 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?如果我已取消链接,Linux 如何仍然知道在“.nvm”目录中查找此命令?

Attempts to figure it out试图弄清楚

  • Ran npm unlinknpm unlink
  • Ran npm uninstall -g mydemonpm uninstall -g mydemo
  • Ran which mydemo (no output) Ran which mydemo (无输出)
  • Searched for symlinks (maybe I didn't search the right place)搜索符号链接(也许我没有搜索正确的地方)

... it still searches that specific ".nvm" directory. ...它仍然搜索特定的“.nvm”目录。

Environment环境

  • Ubuntu 20 Ubuntu 20
  • nvm 0.37.2非虚拟机 0.37.2
  • node v15.8.0节点 v15.8.0
  • "@oclif/dev-cli": "^1.26.0" “@oclif/dev-cli”:“^1.26.0”

Nevermind.没关系。 The command was cached in the shell session, possibly in the $PATH variable.该命令缓存在 shell session 中,可能在 $PATH 变量中。 It cleared in a new user session.它在新用户 session 中清除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM