简体   繁体   English

从源安装nodejs,现在出错

[英]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稳定但是当我从源版本卸载时我遇到了问题。

  1. Installed node from ubuntu repo 来自ubuntu repo的已安装节点
  2. Installed node from source 从源安装节点
  3. Uninstalled node from source ( sudo make uninstall , succeeds) 从源代码卸载节点( sudo make uninstall ,succeeded)
  4. Runnning node results in: 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.) (它不希望每次键入lscat时都重复此搜索,这比查找表中的确切路径名要慢得多。)

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.

相关问题 我从源代码安装了 Node-12,但无法获取 nodejs --version - I installed Node-12 from source but can't get nodejs --version 我可以删除从 Source 构建 NodeJS 时安装的构建依赖项(例如 g++、gcc、libstdc++6 等)吗? - Can I remove the build dependencies installed when building NodeJS from Source (such as g++, gcc, libstdc++6, etc )? 尝试获取openshift / nodejs上已安装模块的列表时出错 - Errors on trying to get a list of installed modules on openshift/nodejs 卸载从二进制分发文件安装的nodejs - Uninstall nodejs installed from binary distribution files nodejs:已经安装了更高版本的 Node.js。 安装程序现在将退出 - nodejs: Later version of Node.js is already installed. Setup will now exit 这些错误阻止了我的 nodejs 应用程序加载 - These errors are preventing my nodejs app from loading 如何在 Nodejs 的回调中处理错误 - How to handle errors from within a callback in Nodejs 从字符串[Nodejs]中提取img标签源 - Extract img tag source from string [Nodejs] 使用Node.js 7.7.4从源构建Atom时出错 - Error building Atom from source with Nodejs 7.7.4 既然 appcfg 不见了,就从 app_engine 下载源代码? - Download source code from app_engine now that appcfg is gone?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM