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 ...
随机推荐
- ios xib和代码的frame布局 iOSXib布局后代码修改约束的值
如何修改autolayout 约束的值? 1 2 3 4 5 6 目前我已知的方法有5种 1.修改frame(有时候可能会不起作用,但可以做动画) 2.修改约束的float值 3.使用VisualFo ...
- iis部署wcf服务
win8的如下 . 打开iis新建一个应用程序MyWcfTest 检查iis中的处理程序映射,含有svc说明激活了. 然后把svc文件和webconfig放入到指定的目录上. 使用地址http://l ...
- MapReduce教程(一)基于MapReduce框架开发<转>
1 MapReduce编程 1.1 MapReduce简介 MapReduce是一种编程模型,用于大规模数据集(大于1TB)的并行运算,用于解决海量数据的计算问题. MapReduce分成了两个部分: ...
- OpenWRT中的按键和灯的GPIO控制实现_转
本文转自:OpenWRT中的按键和灯的GPIO控制实现 基于BarrierBreaker版本,基于AR9331 AP121 Demo单板 来进行描述 1.灯 A.在mach-ap121.c中,定义了灯 ...
- Java编程的逻辑 (75) - 并发容器 - 基于SkipList的Map和Set
本系列文章经补充和完善,已修订整理成书<Java编程的逻辑>,由机械工业出版社华章分社出版,于2018年1月上市热销,读者好评如潮!各大网店和书店有售,欢迎购买,京东自营链接:http: ...
- 01,WP8开发基础
1,wp应用程序的生命周期 编写wp程序,首先必须要搞懂程序的生命周期,因为我们需要在这些不同的时间点做一些必要的事情,比如保存和恢复一些数据.下面这几个事件是我们必须关注的. Applicatoin ...
- python计算机视觉项目实践
这是一个贝叶斯模型的计算机视觉小项目.希望大家通过这个简单的项目知道一般的计算机视觉项目是怎样操作的. 我先讲题目放在这里希望有兴趣的童鞋花一周的时间思考并用python实现.一周以后我来发布我的详细 ...
- IDEA 中 同一个微服务 按照多个端口启动
网上讲这个东西的很多,抄来抄去的,大部分类似,多数没讲明白为什么那么配置. 譬如eureka.client.register-with-eureka和fetch-registry是否要配置,配不配区别 ...
- jQuery&CSS 顶部和底部固定浮动工具栏 兼容IE6
http://www.cnblogs.com/lhj588/archive/2013/04/02/2994639.html —————————————————————————————————————— ...
- JQ 获取窗体的高度
alert($(window).height()); //浏览器时下窗口可视区域高度 alert($(document).height()); //浏览器时下窗口文档的高度 alert($(docum ...