[英]installed nodejs from source, now errors
I'm on ubuntu. 我在ubuntu上。 Installed node from ubuntu repository and everything was fine. 从ubuntu存储库安装节点,一切都很好。 Needed node-waf for one of the modules I was trying to install so I installed node to latest unstable from source. 我试图安装的其中一个模块需要node-waf所以我从源安装了最新的不稳定节点。 Now npm is broken. 现在npm坏了。 Want to go back to node 0.4 stable but when I uninstall the from source version i'm having problems. 想要回到节点0.4稳定但是当我从源版本卸载时我遇到了问题。
sudo make uninstall
, succeeds) 从源代码卸载节点( sudo make uninstall
,succeeded) bash: /usr/local/bin/node: No such file or directory
运行节点导致: bash: /usr/local/bin/node: No such file or directory
How can I get it to stop looking for node in that path? 如何让它停止在该路径中寻找节点? Ubuntu repo node binaries still exist in /usr/bin/node
. Ubuntu repo节点二进制文件仍存在于/usr/bin/node
。 Running 运行
cd /usr/bin ; ./node -v
works and spits out v0.4.12. 工作和吐出v0.4.12。
Running 运行
cd /usr/bin ; node
errors. 错误。
The bash(1)
shell will store the full pathname of an executable the first time it must search through the directories in the PATH
environment variable. bash(1)
shell将在第一次必须搜索PATH
环境变量中的目录时存储可执行文件的完整路径名。 (It doesn't want to repeat this search every single time you type ls
or cat
, that'd be significantly slower than just looking up the exact pathname in a table.) (它不希望每次键入ls
或cat
时都重复此搜索,这比查找表中的确切路径名要慢得多。)
This process normally works without incident -- until you (re)move an executable between directories in the PATH
. 这个过程通常无异常 - 直到您(重新)在PATH
目录之间移动可执行文件。
New shells will not have trouble. 新炮弹不会有问题。 Existing shells will need you to run hash -r
to remove all the mappings from the built-in table. 现有shell将需要您运行hash -r
以从内置表中删除所有映射。 (Well, you can remove an individual entries using hash -d node
, but re-populating the cache isn't horrible -- you do it every single time you start a shell -- and if there are multiple programs that are now missing, removing them all will save you from removing them individually.) (好吧,您可以使用hash -d node
删除单个条目,但重新填充缓存并不可怕 - 每次启动shell时都会这样做 - 如果有多个程序现在丢失,将它们全部删除将使您无法单独删除它们。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.