Bower无法安装的解决思路

1.安装失败

qian@qian-K45VM ~ %  npm install bower -g 
npm ERR! Linux 4.4.0-79-generic
npm ERR! argv "/home/qian/下载/Appium/node/bin/node" "/home/qian/下载/Appium/node/bin/npm" "install" "bower" "-g"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10

npm ERR! failed to fetch from registry: http://registry.cnpmjs.org/bower
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/qian/npm-debug.log

2.看?懵 npm-debug.log

发现在请求的时候出现304,想到自己以前这个是安装过的,所以请求也没变过,所以应该是去读缓存了。不再是重新下载。

HTTP 304 错误:Not Modified 客户端有缓冲的文档并发出了一个条件性的请求(一般是提供If-Modified-Since头表示客户只想比指定日期更新的文档)。服务器告诉客户,原来缓冲的文档还可以继续使用。

3.直接吧lib里面的文件都替换了。

qian@qian-K45VM ~ %  npm install bower -g
npm WARN deprecated bower@1.8.0: ..psst! While Bower is maintained, we recommend Yarn and Webpack for *new* front-end projects! Yarn's advantage is security and reliability, and Webpack's is support for both CommonJS and AMD projects. Currently there's no migration path but we hope you'll help us figure out one.
/home/qian/下载/Appium/node/bin/bower -> /home/qian/下载/Appium/node/lib/node_modules/bower/bin/bower
/home/qian/下载/Appium/node/lib
└── bower@1.8.0 

...结果成功的下载了个弃用的项目,我也是醉了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容