centos6.3中安装nodejs和npm
2015-07-08 17:40
483 查看
查看我本地centos版本:
[wz@supportserver-51 ~]$ rpm -q centos-release centos-release-6-3.el6.centos.9.x86_64
sudo wget https://nodejs.org/dist/v0.12.6/node-v0.12.6-linux-x64.tar.gz[/code]
解压之后发现没有./configure,估计下载错了,然后我去下载这个:sudo wget https://nodejs.org/dist/v0.12.6/node-v0.12.6.tar.gz[/code]
这个可以了:tar zxvf node-v0.12.6.tar.gz cd ./configure make && make install
make && make install 输出了一大堆东西,用了好几分钟,需要耐心等候。node -v v0.12.6
OK,我们进行下一步,安装npm。
参考这里:https://github.com/npm/npm
最后我使用的:[wz@supportserver-51 node-v0.12.6]$ sudo curl -L https://www.npmjs.com/install.sh | sudo sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6239 100 6239 0 0 6841 0 --:--:-- --:--:-- --:--:-- 9934 tar=/bin/tar version: tar (GNU tar) 1.23 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. install npm@latest fetching: http://registry.npmjs.org/npm/-/npm-2.12.1.tgz -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|//usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js npm@2.12.1 /usr/lib/node_modules/npm It worked [wz@supportserver-51 node-v0.12.6]$
在这之前你可能需要建一下软链:sudo ln -s /usr/local/bin/node /usr/bin/node
否则可能会提示你没有安装nodejs无法安装npm。
相关文章推荐
- 使用ruby部署工具mina快速部署nodejs应用教程
- Google官方支持的NodeJS访问API,提供后台登录授权
- nodejs教程之环境安装及运行
- nodejs中的fiber(纤程)库详解
- 基于NodeJS的前后端分离的思考与实践(五)多终端适配
- 基于NodeJS的前后端分离的思考与实践(二)模版探索
- 我的NodeJs学习小结(一)
- nodejs中实现sleep功能实例
- Nodejs异步回调的优雅处理方法
- Windows系统下使用Sublime搭建nodejs环境
- nodejs实现获取某宝商品分类
- nodejs简单实现中英文翻译
- Node.js插件的正确编写方式
- 使用upstart把nodejs应用封装为系统服务实例
- NodeJS Web应用监听sock文件实例
- Nodejs学习笔记之测试驱动
- Nodejs学习笔记之Stream模块
- 如何正确使用Nodejs 的 c++ module 链接到 OpenSSL
- Nodejs为什么选择javascript为载体语言
- Nodejs极简入门教程(一):模块机制