bash: /usr/bin/npm: No such file or directory
一个整得很烂了的Ubuntu服务器, 各种问题乱出. npm老是升不到最新版(一直显示1.4),于是我干脆删了, 结果再去装却装不上了, 如果用apt-get install npm安装, 就得到如下错误:
The following packages have unmet dependencies:
npm : Depends: nodejs but it is not going to be installed
Depends: nodejs-dev
Depends: node-request but it is not going to be installed
Depends: node-mkdirp but it is not going to be installed
Depends: node-minimatch but it is not going to be installed
Depends: node-semver but it is not going to be installed
Depends: node-ini but it is not going to be installed
Depends: node-graceful-fs but it is not going to be installed
Depends: node-abbrev but it is not going to be installed
Depends: node-nopt but it is not going to be installed
Depends: node-fstream but it is not going to be installed
Depends: node-rimraf but it is not going to be installed
Depends: node-tar but it is not going to be installed
Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
官网居然只提供这种方法,结果发现在其github主页上提供的方法是: curl -L https://npmjs.com/install.sh | sh 成功.
仍然不能用:
npm -v
bash: /usr/bin/npm: No such file or directory
一通乱搜, 对着各种解决方法乱试, 也没真正解决,那只有自己思考一下了:
- npm既然装上了,那么装到哪去了(找到了)
- 直接到安装目录执行(成功了)
- 那么就软链一下试试(成功了)
root@walker:~# find / -name "npm-cli.js"
/root/.node/lib/node_modules/npm/bin/npm-cli.js
root@walker:~# /root/.node/lib/node_modules/npm/bin/npm-cli.js -v
2.1.17
root@walker:~# ln -s /root/.node/lib/node_modules/npm/bin/npm-cli.js /usr/bin/npm
root@walker:~# npm -v
2.1.17
p.s. 虽然npm正常工作了,最后发现npm install一个包都下不下来, 执行了一句npm cache clean,貌似就OK了
bash: /usr/bin/npm: No such file or directory的更多相关文章
- linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案
linux输入yum后提示: -bash: /usr/bin/yum: No such file or directory的解决方案 今天在安装程序时,发现有一个插件未安装,我就随手敲了一个命令,看都 ...
- xmanager运行报错:bash: /usr/bin/xterm: No such file or directory
1.原因 xterm没有安装,解决办法是下载然后安装即可. 如果机器可以用yum,则直接使用yum安装xterm即可: yum install -y xterm 如果没有网络,则在某台操作系统大版本相 ...
- git 源码安装后报错/usr/bin/git: No such file or directory
现象 今天源码安装一个git后,执行git命令后报如下错误: $ git --version -bash: /usr/bin/git: No such file or directory 分析过程 开 ...
- java配置好jdk-bash: /usr/bin/java: No such file or directory
在 Linux 系统中安装 JDK 环境,配置好环境变量后,输入 java.javac 或者 java -version 等时,都提示如下错误: -bash: /usr/local/java/bin/ ...
- zsh: /usr/local/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory
系统升级为 macOS Catalina 发现 CocoaPods 不管用了. 解决方法: 打开 iTerm2 sudo gem update --system 输入电脑密码,然后 sudo gem ...
- -bash: /usr/librxec/grepconf.sh:Nosuch file or directory
最近修改/etc/profile文件时,不小心在后面添加了source /etc/profile,导致使用xshell登录远程linux的时候出现下面的信息, 一直无法进入linux,将profile ...
- -bash: /usr/local/bin/react-native: No such file or directory
执行react-native run-android/run-ios的时候出现 -bash: /usr/local/bin/react-native: No such file or director ...
- bash: /usr/lib/jvm/jdk1.7.0_80/bin/java: No such file or directory 问题
在安装java的时候,经常会遇到一些奇奇怪怪的问题. 在配置好环境变量之后,执行java -version,出现: bash: /usr/lib/jvm/jdk1.7.0_80/bin/java: N ...
- -bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory python多版本造成额问题 找不到p ...
随机推荐
- JavaScript高级 面向对象(12)--引用类型值类型作为参数传递的特性
说明(2017-4-2 18:27:11): 1. 作为函数的参数,就是将函数的数据拷贝一份,传递给函数的定义中的参数. 函数foo()在调用的时候,做了两件事: (1)函数在调用的时候,首先需要将参 ...
- iOSUIPickerView使用
#import <UIKit/UIKit.h> @interface ViewController : UIViewController<UIPickerViewDelegate,U ...
- Struts标签判断当前用户是否存在
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...
- python 获取有关访问者的浏览器的 细节
检测访问者的浏览器和版本号有关访问者的浏览器的更多信息有关访问者的浏览器的全部细节根据浏览器来提醒用户 <html><body><script type="te ...
- CSS超过指定的宽度加省略号
/*table-layout:fixed 会使表格均等分*/ #TreeView1 table { width:290px; table-layout: fixed; } #TreeView1 td: ...
- [Note] Collaborator vs. the Factory
Collaborator-vs-he-Factoryhtml, body {overflow-x: initial !important;}html { font-size: 14px; } body ...
- VMware下的Centos7联网并设置固定IP
安装CentOS7之后总得联网呀,而且不能一直连服务器,我们需要一个其他工具连它,所以一个固定IP也很重要了. 工具/原料 CentOS7 VMware 方法/步骤 首先设置vmware能 ...
- SpringCloud 详解配置刷新的原理 使用jasypt自动加解密后 无法使用 springcloud 中的自动刷新/refresh功能
之所以会查找这篇文章,是因为要解决这样一个问题: 当我使用了jasypt进行配置文件加解密后,如果再使用refresh 去刷新配置,则自动加解密会失效. 原因分析:刷新不是我之前想象的直接调用conf ...
- XXXXX
http://www.java-gaming.org/topics/laser-fx-opengl-libgdx/25402/view.html Libgdx游戏引擎之Dialog组件 http:// ...
- JavaScript: The Good Parts
Chapter 1 Good Parts: JavaScript is an important language because it is the language of the web brow ...